Sha256: fd1819f8d0b96d2471c4ca08dce81f98b676a659922261af493953d1c62526f2
Contents?: true
Size: 773 Bytes
Versions: 1
Compression:
Stored size: 773 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 match "1 example, 0 failures" And the stdout should match "should be bigger than 4"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rspec-1.2.8 | features/matchers/define_matcher_with_fluent_interface.feature |