Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/mocks/example_methods.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/mocks/example_methods.rb 69 32
72.46%
50.00%

Key

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.

Coverage Details

1 module Spec
2   module Mocks
3     module ExampleMethods
4       include Spec::Mocks::ArgumentMatchers
5 
6       # Shortcut for creating an instance of Spec::Mocks::Mock.
7       #
8       # +name+ is used for failure reporting, so you should use the
9       # role that the double is playing in the example.
10       #
11       # +stubs_and_options+ lets you assign options and stub values
12       # at the same time. The only option available is :null_object.
13       # Anything else is treated as a stub value.
14       #
15       # == Examples
16       #
17       #   thing = double("thing", :a => "A")
18       #   thing.a == "A" => true
19       #
20       #   person = double("thing", :name => "Joe", :email => "joe@domain.com")
21       #   person.name => "Joe"
22       #   person.email => "joe@domain.com"
23       def double(*args)
24         __declare_double('Double', *args)
25       end
26 
27       # Alias for double
28       def mock(*args)
29         __declare_double('Mock', *args)
30       end
31 
32       # Alias for double
33       def stub(*args)
34         __declare_double('Stub', *args)
35       end
36 
37       def __declare_double(declared_as, *args) # :nodoc:
38         args << {} unless Hash === args.last
39         args.last[:__declared_as] = declared_as
40         Spec::Mocks::Mock.new(*args)
41       end
42 
43       # DEPRECATED - use double('name').as_null_object instead
44       #
45       # Shortcut for creating a mock object that will return itself in response
46       # to any message it receives that it hasn't been explicitly instructed
47       # to respond to.
48       def stub_everything(name = 'stub')
49         Spec.warn(<<-WARNING)
50 
51 DEPRECATION: stub_everything('#{name}') is deprecated and will be removed
52 from a future version of rspec. Please use double('#{name}').as_null_object
53 (or stub('#{name}').as_null_object or mock('#{name}').as_null_object instead.
54 
55 WARNING
56         mock(name, :null_object => true)
57       end
58 
59       # Disables warning messages about expectations being set on nil.
60       #
61       # By default warning messages are issued when expectations are set on nil.  This is to
62       # prevent false-positives and to catch potential bugs early on.
63       def allow_message_expectations_on_nil
64         Proxy.allow_message_expectations_on_nil
65       end
66 
67     end
68   end
69 end

Generated on Mon May 10 23:40:27 -0700 2010 with rcov 0.9.8