Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

It's a warning, not an error.

  • Loading branch information...
commit 0e706c60dfff0f996d4e0d61ff337582b1a7565e 1 parent 518a0f7
@myronmarston myronmarston authored
Showing with 10 additions and 8 deletions.
  1. +10 −8 spec/rspec/expectations/syntax_spec.rb
View
18 spec/rspec/expectations/syntax_spec.rb
@@ -4,26 +4,28 @@ module RSpec
module Expectations
module Syntax
describe "the should and should_not expectations" do
+ let(:warner) { ::Kernel }
+
describe "#should" do
- it "raises an error when the message object isn't a String" do
- ::Kernel.should_receive(:warn).with /The value passed as the message/
+ 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 raise an error when message is a String" do
- ::Kernel.should_not_receive(:warn).with /The value passed as the message/
+ 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 "raises an error when the message object isn't a String" do
- ::Kernel.should_receive(:warn).with /The value passed as the message/
+ 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 raise an error when message is a String" do
- ::Kernel.should_not_receive(:warn).with /The value passed as the message/
+ 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
Please sign in to comment.
Something went wrong with that request. Please try again.