Sha256: f89d6d0d482d52a9cac3306b3a36a5b1619320ebed9d4b473b575912d27e94c3

Contents?: true

Size: 737 Bytes

Versions: 23

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

23 entries across 23 versions & 3 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.3.0 features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-expectations-2.1.0/features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.2.0 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.1.0 features/matchers/define_matcher_with_fluent_interface.feature
rspec-expectations-2.0.1 features/matchers/define_matcher_with_fluent_interface.feature
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.4.1 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.4.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.3.2 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.3.1 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.3.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.2.0 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.1.2 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature
gemrage-0.1.1 vendor/ruby/1.8/gems/rspec-expectations-2.0.0/features/matchers/define_matcher_with_fluent_interface.feature