spec/cucumber/step_match_spec.rb in cucumber-2.1.0 vs spec/cucumber/step_match_spec.rb in cucumber-2.2.0

- old
+ new

@@ -6,19 +6,25 @@ module Cucumber describe StepMatch do WORD = '[[:word:]]' before do - @rb_language = RbSupport::RbLanguage.new(nil) + @rb_language = RbSupport::RbLanguage.new(nil, Configuration.new) end def stepdef(regexp) RbSupport::RbStepDefinition.new(@rb_language, regexp, lambda{}, {}) end def step_match(regexp, name) stepdef = stepdef(regexp) - StepMatch.new(stepdef, name, nil, stepdef.arguments_from(name)) + StepMatch.new(stepdef, name, stepdef.arguments_from(name)) + end + + it "formats step names" do + m = step_match(/it (.*) in (.*)/, "it snows in april") + format = m.format_args("[%s]") + expect(format).to eq "it [snows] in [april]" end it "formats one group when we use Unicode" do m = step_match(/I (#{WORD}+) ok/, "I æøåÆØÅæøåÆØÅæøåÆØÅæøåÆØÅ ok")