Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

fix pending substep's message #89

Closed
wants to merge 1 commit into from

2 participants

sergey kuchmistov Jonas Nicklas
sergey kuchmistov

I see when unimplemented step called from other step definition, it shows wrong step in pending message.

I've just add puts @result to https://github.com/jnicklas/turnip/blob/master/spec/integration_spec.rb#L5

Step-calling steps when the called step is not visible an invisible step call  #<= dup
# No such step: 'an invisible step call'  #<= dup
# ./examples/step_calling.feature:68

This step exists thus we need something like this:

Step-calling steps when the called step is not visible an invisible step call
# No such step: 'this is an unimplemented step'
# ./examples/step_calling.feature:68

step definition: https://github.com/jnicklas/turnip/blob/master/examples/steps/step_calling_steps.rb#L11

Jonas Nicklas
Owner

Seems like this has already been fixed. It seems that the file and line number is still wrong, but this PR didn't fix this either. I looked into if this was fixable, but it would be pretty tricky I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 09, 2013
sergey kuchmistov caulfield fix pending substep's message 42a5f0a
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 lib/turnip/rspec.rb
  2. +5 0 spec/integration_spec.rb
4 lib/turnip/rspec.rb
@@ -42,8 +42,8 @@ module Execute
42 42 def run_step(feature_file, step)
43 43 begin
44 44 step(step)
45   - rescue Turnip::Pending
46   - pending("No such step: '#{step}'")
  45 + rescue Turnip::Pending => e
  46 + pending("No such step: '#{e.message}'")
47 47 rescue StandardError => e
48 48 e.backtrace.push "#{feature_file}:#{step.line}:in `#{step.description}'"
49 49 raise e
5 spec/integration_spec.rb
@@ -17,4 +17,9 @@
17 17 it "includes features in backtraces" do
18 18 @result.should include('examples/errors.feature:5:in `raise error')
19 19 end
  20 +
  21 + it "includes pending substep description" do
  22 + @result.should include("No such step: 'this is an unimplemented step'")
  23 + @result.should_not include("No such step: 'an invisible step call'")
  24 + end
20 25 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.