Sha256: a7b2b1148264a1ebdc93b457807ee83e88eb1c1a852755719eb20d7668a42adc

Contents?: true

Size: 739 Bytes

Versions: 35

Compression:

Stored size: 739 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:
      """ruby
      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

35 entries across 35 versions & 8 rubygems

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