Sha256: 1247d93d0aa6c5ef64295717cc436891eabd100755b407ed2df2213516fbf0cd

Contents?: true

Size: 777 Bytes

Versions: 26

Compression:

Stored size: 777 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:
      """
      Spec::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 "spec between_spec.rb --format specdoc"
    Then the stdout should include "1 example, 0 failures"
    And  the stdout should include "should be bigger than 4"

Version data entries

26 entries across 26 versions & 9 rubygems

Version Path
hubbub-0.0.11 lib/vendor/plugins/rspec/features/matchers/define_matcher_with_fluent_interface.feature
hubbub-0.0.10 lib/vendor/plugins/rspec/features/matchers/define_matcher_with_fluent_interface.feature
hubbub-0.0.9 lib/vendor/plugins/rspec/features/matchers/define_matcher_with_fluent_interface.feature
hubbub-0.0.8 lib/vendor/plugins/rspec/features/matchers/define_matcher_with_fluent_interface.feature
hubbub-0.0.6 lib/vendor/plugins/rspec/features/matchers/define_matcher_with_fluent_interface.feature
simple-templater-0.0.1.4 gems/gems/rspec-1.2.9/features/matchers/define_matcher_with_fluent_interface.feature
media-path-0.1.2 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
simple-templater-0.0.1.3 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
pupu-0.0.2.pre vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
media-path-0.1.1.pre vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
simple-templater-0.0.1.2 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
media-path-0.1.1 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
simple-templater-0.0.1.1 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
pupu-0.0.2 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
rango-0.0.6 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
rango-0.1.pre vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
pupu-0.0.1 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
media-path-0.1 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
simple-templater-0.0.1 vendor/rspec/features/matchers/define_matcher_with_fluent_interface.feature
middleman-0.10.17 vendor/gems/gems/rspec-1.2.9/features/matchers/define_matcher_with_fluent_interface.feature