Sha256: 0d31ea76bc2f67d0aa498091f5fc6503ca14df31c983220dbbbfa23ae6e8a942

Contents?: true

Size: 1.09 KB

Versions: 42

Compression:

Stored size: 1.09 KB

Contents

Feature: satisfy matcher

  The satisfy matcher is extremely flexible and can handle almost anything
  you want to specify.  It passes if the block you provide returns true:

    ```ruby
    10.should satisfy { |v| v % 5 == 0 }
    7.should_not satisfy { |v| v % 5 == 0 }
    ```

  This flexibility comes at a cost, however: the failure message
  ("expected [actual] to satisfy block") is not very descriptive
  or helpful.  You will usually be better served by using one of
  the other built-in matchers, or writing a custom matcher.

  Scenario: basic usage
    Given a file named "satisfy_matcher_spec.rb" with:
      """ruby
      describe 10 do
        it { should satisfy { |v| v > 5 } }
        it { should_not satisfy { |v| v > 15 } }

        # deliberate failures
        it { should_not satisfy { |v| v > 5 } }
        it { should satisfy { |v| v > 15 } }
      end
      """
    When I run `rspec satisfy_matcher_spec.rb`
    Then the output should contain all of these:
      | 4 examples, 2 failures           |
      | expected 10 not to satisfy block |
      | expected 10 to satisfy block     |

Version data entries

42 entries across 42 versions & 12 rubygems

Version Path
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
dxruby_rp5-0.0.2 spec/vendor/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
dxruby_rp5-0.0.1 spec/vendor/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/rspec-expectations-2.14.4/features/built_in_matchers/satisfy.feature
rspec-expectations-2.99.0.beta1 features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.4 features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.3 features/built_in_matchers/satisfy.feature
clickable_link-0.0.2 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.14.2/features/built_in_matchers/satisfy.feature
syllable_counter-1.0.0 vendor/bundle/gems/rspec-expectations-2.14.2/features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.2 features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.1 features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.0 features/built_in_matchers/satisfy.feature
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.13.0/features/built_in_matchers/satisfy.feature
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-expectations-2.13.0/features/built_in_matchers/satisfy.feature
rspec-expectations-2.14.0.rc1 features/built_in_matchers/satisfy.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-expectations-2.13.0/features/built_in_matchers/satisfy.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-expectations-2.13.0/features/built_in_matchers/satisfy.feature