Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
converted implicit_docstrings.feature to new step style.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmabey committed Apr 2, 2009
1 parent 6d60a0e commit e6a49d6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 28 deletions.
10 changes: 5 additions & 5 deletions examples/failing/failing_implicit_docstrings_example.rb
Expand Up @@ -3,17 +3,17 @@
# Run spec w/ -fs to see the output of this file

describe "Failing examples with no descriptions" do

# description is auto-generated as "should equal(5)" based on the last #should
it do
3.should equal(2)
5.should equal(5)
end

it { 3.should be > 5 }

it { ["a"].should include("b") }

it { [1,2,3].should_not respond_to(:size) }

end
6 changes: 3 additions & 3 deletions examples/passing/implicit_docstrings_example.rb
Expand Up @@ -5,11 +5,11 @@
describe "Examples with no docstrings generate their own:" do

specify { 3.should be < 5 }

specify { ["a"].should include("a") }

specify { [1,2,3].should respond_to(:size) }

end

describe 1 do
Expand Down
56 changes: 36 additions & 20 deletions features/example_groups/implicit_docstrings.feature
Expand Up @@ -4,38 +4,54 @@ Feature: implicit docstrings
I want examples to generate their own names
So that I can reduce duplication between example names and example code

Scenario: run passing examples with ruby
Given the file ../../examples/passing/implicit_docstrings_example.rb
Scenario Outline: run passing examples
Given a file named "implicit_docstrings_example.rb" with:
"""
require 'spec/autorun'
describe "Examples with no docstrings generate their own:" do
When I run it with the ruby interpreter -fs
specify { 3.should be < 5 }
And the stdout should match /should be < 5/
specify { ["a"].should include("a") }
specify { [1,2,3].should respond_to(:size) }
end
"""

When I run "<Command> implicit_docstrings_example.rb -fs"

Then the stdout should match /should be < 5/
And the stdout should match /should include "a"/
And the stdout should match /should respond to #size/
Scenario: run failing examples with ruby
Given the file ../../examples/failing/failing_implicit_docstrings_example.rb
Scenarios: Run with ruby and spec
| Command |
| ruby |
| spec |
When I run it with the ruby interpreter -fs
Scenario Outline: run failing examples
Given a file named "failing_implicit_docstrings_example.rb" with:
"""
require 'spec/autorun'
describe "Failing examples with no descriptions" do
Then the stdout should match /should equal 2/
And the stdout should match /should be > 5/
And the stdout should match /should include "b"/
And the stdout should match /should not respond to #size/
# description is auto-generated as "should equal(5)" based on the last #should
it do
3.should equal(2)
5.should equal(5)
end
Scenario: run passing examples with spec
Given the file ../../examples/passing/implicit_docstrings_example.rb
it { 3.should be > 5 }

When I run it with the spec command -fs
it { ["a"].should include("b") }

And the stdout should match /should be < 5/
And the stdout should match /should include "a"/
And the stdout should match /should respond to #size/
it { [1,2,3].should_not respond_to(:size) }

Scenario: run failing examples with spec
Given the file ../../examples/failing/failing_implicit_docstrings_example.rb
end
"""
When I run it with the spec command -fs
When I run "<Command> failing_implicit_docstrings_example.rb -fs"
Then the stdout should match /should equal 2/
And the stdout should match /should be > 5/
Expand Down

0 comments on commit e6a49d6

Please sign in to comment.