Sha256: 821701518aa5c063a83058ca905fdc379a905befce81162c3377d43726e16968

Contents?: true

Size: 1.58 KB

Versions: 12

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 'rspec/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 'rspec/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

12 entries across 12 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.2 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.beta.1 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a10 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a9 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a8 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a7 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a6 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a5 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a4 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a3 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a2 features-pending/example_groups/implicit_docstrings.feature
rspec-core-2.0.0.a1 features-pending/example_groups/implicit_docstrings.feature