Sha256: 42f829a20485ae1b22e9ac5a81de11cca09cf3fa3522f02122b356179a2414ea

Contents?: true

Size: 1.55 KB

Versions: 13

Compression:

Stored size: 1.55 KB

Contents

Feature: --line_number option

  To run a examples or groups by line numbers, one can use the --line_number option:

      rspec path/to/example_spec.rb --line_number 37

  This option can be specified multiple times.

  Scenario: standard examples
    Given a file named "example_spec.rb" with:
      """ruby
      require "rspec/expectations"

      describe 9 do

        it "should be > 8" do
          9.should be > 8
        end

        it "should be < 10" do
          9.should be < 10
        end

        it "should be 3 squared" do
          9.should be 3*3
        end

      end
      """
    When I run `rspec example_spec.rb --line_number 5 --format doc`
    Then the examples should all pass
    And the output should contain "should be > 8"
    But the output should not contain "should be < 10"
    And the output should not contain "should be 3*3"

    When I run `rspec example_spec.rb --line_number 5 --line_number 9 --format doc`
    Then the examples should all pass
    And the output should contain "should be > 8"
    And the output should contain "should be < 10"
    But the output should not contain "should be 3*3"

  Scenario: one liner
    Given a file named "example_spec.rb" with:
      """ruby
      require "rspec/expectations"

      describe 9 do

        it { should be > 8 }

        it { should be < 10 }
        
      end
      """
    When I run `rspec example_spec.rb --line_number 5 --format doc`
    Then the examples should all pass
    Then the output should contain "should be > 8"
    But the output should not contain "should be < 10"

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-core-2.13.0/features/command_line/line_number_option.feature
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/command_line/line_number_option.feature
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/command_line/line_number_option.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/command_line/line_number_option.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/command_line/line_number_option.feature
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-core-2.13.0/features/command_line/line_number_option.feature
rspec-core-2.13.1 features/command_line/line_number_option.feature
rspec-core-2.13.0 features/command_line/line_number_option.feature
remq-0.0.4 vendor/bundle/gems/rspec-core-2.12.2/features/command_line/line_number_option.feature
remq-0.0.3 vendor/bundle/gems/rspec-core-2.12.2/features/command_line/line_number_option.feature
rspec-core-2.12.2 features/command_line/line_number_option.feature
rspec-core-2.12.1 features/command_line/line_number_option.feature
rspec-core-2.12.0 features/command_line/line_number_option.feature