Sha256: 1356e7c4490dd471c468a588e3383a91182fd9750e6a03699cdd6c3c4db4f7b4

Contents?: true

Size: 1.5 KB

Versions: 42

Compression:

Stored size: 1.5 KB

Contents

@ruby-1.9
Feature: cover matcher

  Use the cover matcher to specify that a range covers one or more
  expected objects.  This works on any object that responds to #cover?  (such
  as a Range):

    ```ruby
    (1..10).should cover(5)
    (1..10).should cover(4, 6)
    (1..10).should_not cover(11)
    ```

  Scenario: range usage
    Given a file named "range_cover_matcher_spec.rb" with:
      """ruby
      describe (1..10) do
        it { should cover(4) }
        it { should cover(6) }
        it { should cover(8) }
        it { should cover(4, 6) }
        it { should cover(4, 6, 8) }
        it { should_not cover(11) }
        it { should_not cover(11, 12) }

        # deliberate failures
        it { should cover(11) }
        it { should_not cover(4) }
        it { should_not cover(6) }
        it { should_not cover(8) }
        it { should_not cover(4, 6, 8) }

        # both of these should fail since it covers 5 but not 11
        it { should cover(5, 11) }
        it { should_not cover(5, 11) }
      end
      """
    When I run `rspec range_cover_matcher_spec.rb`
    Then the output should contain all of these:
      | 14 examples, 7 failures                 |
      | expected 1..10 to cover 11              |
      | expected 1..10 not to cover 4           |
      | expected 1..10 not to cover 6           |
      | expected 1..10 not to cover 8           |
      | expected 1..10 not to cover 4, 6, and 8 |
      | expected 1..10 to cover 5 and 11        |
      | expected 1..10 not to cover 5 and 11    |

Version data entries

42 entries across 42 versions & 12 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-expectations-2.14.5/features/built_in_matchers/cover.feature
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-expectations-2.13.0/features/built_in_matchers/cover.feature
rspec-expectations-2.99.2 features/built_in_matchers/cover.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-expectations-2.14.4/features/built_in_matchers/cover.feature
rspec-expectations-2.99.1 features/built_in_matchers/cover.feature
rspec-expectations-2.99.0 features/built_in_matchers/cover.feature
rspec-expectations-2.99.0.rc1 features/built_in_matchers/cover.feature
rspec-expectations-2.99.0.beta2 features/built_in_matchers/cover.feature
rspec-expectations-2.14.5 features/built_in_matchers/cover.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/cover.feature
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/cover.feature
dxruby_rp5-0.0.3 spec/vendor/rspec-expectations-2.14.4/features/built_in_matchers/cover.feature