C0 code coverage information
Generated on Sun Oct 26 11:18:15 -0500 2008 with rcov 0.8.1.2
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
1 require File.dirname(__FILE__) + '/../spec_helper'
2 require 'aquarium/spec_example_types'
3 require 'aquarium/utils/nil_object'
4
5 describe Aquarium::Utils::NilObject, "#eql?" do
6 it "should return true when called with any other NilObject" do
7 nil_object1 = Aquarium::Utils::NilObject.new
8 nil_object2 = Aquarium::Utils::NilObject.new
9 nil_object1.should eql(nil_object1)
10 nil_object1.should eql(nil_object2)
11 nil_object2.should eql(nil_object1)
12 nil_object1.eql?(nil_object1).should be_true
13 nil_object1.eql?(nil_object2).should be_true
14 nil_object2.eql?(nil_object1).should be_true
15 end
16
17 it "should return false when called with any other object" do
18 nil_object = Aquarium::Utils::NilObject.new
19 nil_object.should_not eql(nil)
20 nil_object.should_not eql("nil_object")
21 nil_object.eql?(nil).should be_false
22 nil_object.eql?("nil_object").should be_false
23 end
24 end
25
26 describe Aquarium::Utils::NilObject, " (when a message is sent to it)" do
27 it "should return itself, by default, for methods not defined for Object" do
28 nil_object = Aquarium::Utils::NilObject.new
29 %w[a b foo].each do |method_name|
30 nil_object.send(method_name.to_sym).should == nil_object
31 end
32 end
33
34 it "should invoke Object's methods, when defined" do
35 nil_object = Aquarium::Utils::NilObject.new
36 %w[to_s inspect].each do |method_name|
37 nil_object.send(method_name.to_sym).include?("Aquarium::Utils::NilObject").should be_true
38 end
39 end
40 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.