Created
October 12, 2012 16:43
-
-
Save fables-tales/3880175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
module RSpec | |
module Expectations | |
module Syntax | |
describe "the should and should_not expectations" do | |
describe "#should" do | |
it "raises an error when the message object isn't a String" do | |
3.should eq(3), :not_a_string | |
::Kernel.should_receive(:warn) | |
end | |
it "doesn't raise an error when message is a String" do | |
3.should eq(3), "a string" | |
::Kernel.should_not_receive(:warn).with /The value passed as the message/ | |
end | |
end | |
#describe "#should_not" do | |
# it "raises an error when the message object isn't a String" do | |
# 3.should_not eq(4), :not_a_string | |
# RSpec::Expectations::Syntax.should_receive(:warn).with /The value passed as the message/ | |
# end | |
# it "doesn't raise an error when message is a String" do | |
# 3.should_not eq(4), "a string" | |
# RSpec.should_not_receive(:warn).with /The value passed as the message/ | |
# end | |
#end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment