Sha256: 265e3966c1427513e7729ff4a358c0e2b2535d2d8358e92f8ad28e5201145cbc

Contents?: true

Size: 1.58 KB

Versions: 6

Compression:

Stored size: 1.58 KB

Contents

Feature: implicit docstrings

  As an RSpec user
  I want examples to generate their own names
  So that I can reduce duplication between example names and example code

  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

      specify { 3.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/

  Scenarios: Run with ruby and spec
    | Command |
    | ruby    |
    | spec    |

  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

      # 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
    """

    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/
    And the stdout should match /should include "b"/
    And the stdout should match /should not respond to #size/

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-1.2.7 features/example_groups/implicit_docstrings.feature
rspec-1.2.8 features/example_groups/implicit_docstrings.feature
rspec-1.2.3 features/example_groups/implicit_docstrings.feature
rspec-1.2.4 features/example_groups/implicit_docstrings.feature
rspec-1.2.5 features/example_groups/implicit_docstrings.feature
rspec-1.2.6 features/example_groups/implicit_docstrings.feature