Sha256: e4d4c8a0800879bd444ed79a172185f5dde143a46d1b9e36096f4e21cfa06e55

Contents?: true

Size: 1.54 KB

Versions: 150

Compression:

Stored size: 1.54 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:
      """
      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:
      """
      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

150 entries across 95 versions & 14 rubygems

Version Path
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
classicCMS-0.2.3 vendor/bundle/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
classicCMS-0.2.2 vendor/bundle/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
classicCMS-0.2.1 vendor/bundle/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
classicCMS-0.2.0 vendor/bundle/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
classicCMS-0.1.2 vendor/bundle/gems/rspec-core-2.9.0/features/command_line/line_number_option.feature
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/rspec-core-2.8.0/features/command_line/line_number_option.feature
rspec-core-2.9.0 features/command_line/line_number_option.feature
rspec-core-2.9.0.rc2 features/command_line/line_number_option.feature
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-core-2.8.0/features/command_line/line_number_option.feature
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-core-2.8.0/features/command_line/line_number_option.feature
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature
rspec-core-2.8.0 features/command_line/line_number_option.feature
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-core-2.7.1/features/command_line/line_number_option.feature