lib/cucumber/formatter/gherkin_formatter_adapter.rb in cucumber-1.0.0 vs lib/cucumber/formatter/gherkin_formatter_adapter.rb in cucumber-1.0.1

- old
+ new

@@ -9,26 +9,21 @@ def initialize(gherkin_formatter, print_emtpy_match) @gf = gherkin_formatter @print_emtpy_match = print_emtpy_match end - def before_features(features) - end - def before_feature(feature) @gf.uri(feature.file) @gf.feature(feature.gherkin_statement) end def before_background(background) @outline = false - @gf.steps(background.raw_steps) @gf.background(background.gherkin_statement) end def before_feature_element(feature_element) - @gf.steps(feature_element.raw_steps) case(feature_element) when Ast::Scenario @outline = false @gf.scenario(feature_element.gherkin_statement) when Ast::ScenarioOutline @@ -75,10 +70,14 @@ def after_feature(feature) @gf.eof end def embed(file, mime_type, label) - @gf.embedding(mime_type, File.read(file)) + data = File.read(file) + if defined?(JRUBY_VERSION) + data = data.to_java_bytes + end + @gf.embedding(mime_type, data) end end end end