Sha256: 76b99111cc3cc0f209e3f67324224b2cc966100a1684d17927473b4c33af1b63

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 Bytes

Contents

require 'spec_helper'
require 'mspec/expectations/expectations'
require 'mspec/matchers'

describe BeFalseMatcher do
  it "matches when actual is false" do
    BeFalseMatcher.new.matches?(false).should == true
  end

  it "does not match when actual is not false" do
    BeFalseMatcher.new.matches?("").should == false
    BeFalseMatcher.new.matches?(true).should == false
    BeFalseMatcher.new.matches?(nil).should == false
    BeFalseMatcher.new.matches?(0).should == false
  end

  it "provides a useful failure message" do
    matcher = BeFalseMatcher.new
    matcher.matches?("some string")
    matcher.failure_message.should == ["Expected \"some string\"", "to be false"]
  end

  it "provides a useful negative failure message" do
    matcher = BeFalseMatcher.new
    matcher.matches?(false)
    matcher.negative_failure_message.should == ["Expected false", "not to be false"]
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mspec-1.9.1 spec/matchers/be_false_spec.rb
mspec-1.9.0 spec/matchers/be_false_spec.rb
mspec-1.8.0 spec/matchers/be_false_spec.rb
mspec-1.7.0 spec/matchers/be_false_spec.rb
mspec-1.6.0 spec/matchers/be_false_spec.rb
mspec-1.5.21 spec/matchers/be_false_spec.rb
mspec-1.5.20 spec/matchers/be_false_spec.rb
mspec-1.5.19 spec/matchers/be_false_spec.rb
mspec-1.5.18 spec/matchers/be_false_spec.rb