diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2013-10-25 16:26:02 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2013-10-25 16:26:02 -0600 |
| commit | 8ee07da657ca243e667c8a46ae65a4a19d90e3d8 (patch) | |
| tree | a31dbb131723347651531a1629582488c51f3811 /features | |
| parent | c5c94999d2cf2bb3e481a41769d8e4c53fb70d46 (diff) | |
improvement to Cucumber test infrastructure
- make output slim-friendly
- prototype running tests against Python AsciiDoc
Diffstat (limited to 'features')
| -rw-r--r-- | features/step_definitions.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/features/step_definitions.rb b/features/step_definitions.rb index 3dc66cc6..382d9923 100644 --- a/features/step_definitions.rb +++ b/features/step_definitions.rb @@ -4,12 +4,14 @@ require 'tilt' require 'slim' Given /the AsciiDoc source/ do |source| - #@document = Asciidoctor.load source @source = source end When /it is rendered using the html backend/ do @output = Asciidoctor.render @source + #File.open('/tmp/test.adoc', 'w') {|f| f.write @source } + #@output = %x{asciidoc -f compat/asciidoc.conf -o - -s /tmp/test.adoc | XMLLINT_INDENT='' xmllint --format - | tail -n +2}.rstrip + ##@output = %x{asciidoc -f compat/asciidoc.conf -o - -s /tmp/test.adoc} end When /it is rendered using the docbook backend/ do @@ -29,5 +31,12 @@ Then /the output should match the (HTML|XML) structure/ do |format, expect| else options = {} end - Slim::Template.new(options) { @output }.render.should == Slim::Template.new(options) { expect }.render + slim_friendly_output = @output.lines.entries.map {|line| + if line.start_with? '<' + line + else + %(|#{line}) + end + }.join + Slim::Template.new(options) { slim_friendly_output }.render.should == Slim::Template.new(options) { expect }.render end |
