XtextResource r = getResourceFromString(code);
EObject result = r.getContents().get(0);
assertTrue("Should be a PuppetManifest", result instanceof PuppetManifest);
result = ((PuppetManifest) result).getStatements().get(0);
assertTrue("Should be a DoubleQuotedString", result instanceof DoubleQuotedString);
DoubleQuotedString string = (DoubleQuotedString) result;
List<TextExpression> t = string.getStringPart(); // flattenTextExpression(string.getTextExpression());
assertEquals("List should have 3 entries", 3, t.size());
assertEquals("First element should be 'before'", "before", ((VerbatimTE) t.get(0)).getText());
assertTrue("Second element should be VariableTE", t.get(1) instanceof VariableTE);
assertEquals("Second element should be '$var'", "$var", ((VariableTE) t.get(1)).getVarName());
assertEquals("Third element should be '/after'", "/after", ((VerbatimTE) t.get(2)).getText());