spec/rspec/its_spec.rb in rspec-its-1.0.0.pre vs spec/rspec/its_spec.rb in rspec-its-1.0.0
- old
+ new
@@ -39,10 +39,19 @@
end.new
end
its("name") { should eq("John") }
its("name.size") { should eq(4) }
its("name.size.class") { should eq(Fixnum) }
+
+ context "using should_not" do
+ its("name") { should_not eq("Paul") }
+ end
+
+ context "using is_expected" do
+ its("name") { is_expected.to eq("John") }
+ end
+
end
context "when it responds to #[]" do
subject do
Class.new do
@@ -59,10 +68,10 @@
end
its([:a]) { should eq("Symbol: a") }
its(['a']) { should eq("String: a") }
its([:b, 'c', 4]) { should eq("Symbol: b; String: c; Fixnum: 4") }
its(:name) { should eq("George") }
- context "when referring to an attribute without the proper array syntax" do
+ context "when referring to an attribute that doesn't exist" do
context "it raises an error" do
its(:age) do
expect do
should eq(64)
end.to raise_error(NoMethodError)