Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 0e706c60df
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (30 sloc) 1.047 kB
require 'spec_helper'
module RSpec
module Expectations
module Syntax
describe "the should and should_not expectations" do
let(:warner) { ::Kernel }
describe "#should" do
it "prints a warning when the message object isn't a String" do
warner.should_receive(:warn).with /The value passed as the message/
3.should eq(3), :not_a_string
end
it "doesn't print a warning when message is a String" do
warner.should_not_receive(:warn)
3.should eq(3), "a string"
end
end
describe "#should_not" do
it "prints a warning when the message object isn't a String" do
warner.should_receive(:warn).with /The value passed as the message/
3.should_not eq(4), :not_a_string
end
it "doesn't print a warning when message is a String" do
warner.should_not_receive(:warn)
3.should_not eq(4), "a string"
end
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.