Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Created October 12, 2012 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fables-tales/3880175 to your computer and use it in GitHub Desktop.
Save fables-tales/3880175 to your computer and use it in GitHub Desktop.
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