Sha256: 04a400a65ebb4d767411fc64510167f5d11c5719b0de957fb3fa96c0130cdcae
Contents?: true
Size: 1.31 KB
Versions: 56
Compression:
Stored size: 1.31 KB
Contents
require File.expand_path("#{File.dirname(__FILE__)}/../../spec_helper") module RR module TimesCalledMatchers describe AtLeastMatcher do attr_reader :matcher, :times before do @times = 3 @matcher = AtLeastMatcher.new(times) end describe "#possible_match?" do it "always returns true" do matcher.should be_possible_match(99999) end end describe "#matches?" do it "returns false when times_called less than times" do matcher.should_not be_matches(2) end it "returns true when times_called == times" do matcher.should be_matches(3) end it "returns true when times_called > times" do matcher.should be_matches(4) end end describe "#attempt?" do it "always returns true" do matcher.should be_attempt(1) matcher.should be_attempt(100000) end end describe AnyTimesMatcher, "#terminal?" do it "returns false" do matcher.should_not be_terminal end end describe "#error_message" do it "has an error message" do matcher.error_message(2).should == ( "Called 2 times.\nExpected at least 3 times." ) end end end end end
Version data entries
56 entries across 52 versions & 9 rubygems