Sha256: 6788cde19641ca92887339e0c548eb50307ca0ca803f27ed1c68c3018874f3b8

Contents?: true

Size: 1.54 KB

Versions: 33

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

33 entries across 33 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/features/command_line/line_number_option.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/features/command_line/line_number_option.feature
rspec-core-2.14.8 features/command_line/line_number_option.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
dxruby_rp5-0.0.3 spec/vendor/rspec-core-2.14.7/features/command_line/line_number_option.feature
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/features/command_line/line_number_option.feature
dxruby_rp5-0.0.2 spec/vendor/rspec-core-2.14.7/features/command_line/line_number_option.feature
dxruby_rp5-0.0.1 spec/vendor/rspec-core-2.14.7/features/command_line/line_number_option.feature