Sha256: d6daf4cd4da0d332e5655fbdb6a021a80fb0d2b18e3e4bf7fa1d4dc3ddf24270

Contents?: true

Size: 787 Bytes

Versions: 6

Compression:

Stored size: 787 Bytes

Contents

Feature: define matcher

  In order to express my domain clearly in my code examples
  As an RSpec user
  I want to define matchers with fluent interfaces
  
  Scenario: one additional method
    Given a file named "between_spec.rb" with:
      """
      RSpec::Matchers.define :be_bigger_than do |first|
        def but_smaller_than(second)
          @second = second
          self
        end
        
        match do |actual|
          (actual > first) && (actual < @second)
        end
      end

      describe 5 do
        it { should be_bigger_than(4).but_smaller_than(6) }
      end
      """
    When I run "rspec ./between_spec.rb --format documentation"
    Then the output should contain "1 example, 0 failures"
    And  the output should contain "should be bigger than 4"

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.rc features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.0.beta.22 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.0.beta.20 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.0.beta.19 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.0.beta.18 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.0.beta.17 features/matchers/define_matcher_with_fluent_interface.feature