Sha256: 1213a23456b8dacf4a710835df16473c997252768882fd80aba0829c60962fb9

Contents?: true

Size: 737 Bytes

Versions: 201

Compression:

Stored size: 737 Bytes

Contents

Feature: define matcher with fluent interface

  Use the chain() method to define matchers with a fluent interface.
  
  Scenario: chained method with argumetn
    Given a file named "between_spec.rb" with:
      """
      RSpec::Matchers.define :be_bigger_than do |first|
        match do |actual|
          (actual > first) && (actual < @second)
        end

        chain :but_smaller_than do |second|
          @second = 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

201 entries across 100 versions & 14 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.5 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/features/custom_matchers/define_matcher_with_fluent_interface.feature
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.11.3/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.10.0/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.1/features/custom_matchers/define_matcher_with_fluent_interface.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-expectations-2.9.0/features/custom_matchers/define_matcher_with_fluent_interface.feature