Sha256: 89f6fd86c11ec2ed8c4cb2fa3b4d58eaec9a5bfad60d8dcafac0f384ff32d118

Contents?: true

Size: 774 Bytes

Versions: 12

Compression:

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rspec-core-2.0.0.beta.2 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.beta.1 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a10 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a9 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a8 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a7 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a6 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a5 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a4 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a3 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a2 features-pending/matchers/define_matcher_with_fluent_interface.feature
rspec-core-2.0.0.a1 features-pending/matchers/define_matcher_with_fluent_interface.feature