Sha256: 9eb736010ffebee30156ef5cfdc3a4a728f5a47bbd7482ed0c6de7d79579aabe
Contents?: true
Size: 815 Bytes
Versions: 9
Compression:
Stored size: 815 Bytes
Contents
require 'spec_helper' require 'mspec/expectations/expectations' require 'mspec/matchers' describe BeNilMatcher do it "matches when actual is nil" do BeNilMatcher.new.matches?(nil).should == true end it "does not match when actual is not nil" do BeNilMatcher.new.matches?("").should == false BeNilMatcher.new.matches?(false).should == false BeNilMatcher.new.matches?(0).should == false end it "provides a useful failure message" do matcher = BeNilMatcher.new matcher.matches?("some string") matcher.failure_message.should == ["Expected \"some string\"", "to be nil"] end it "provides a useful negative failure message" do matcher = BeNilMatcher.new matcher.matches?(nil) matcher.negative_failure_message.should == ["Expected nil", "not to be nil"] end end
Version data entries
9 entries across 9 versions & 1 rubygems