flexmock 0.8.11 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/README.rdoc +2 -2
  2. data/Rakefile +23 -65
  3. data/TAGS +689 -691
  4. data/doc/releases/flexmock-0.9.0.rdoc +89 -0
  5. data/lib/flexmock.rb +1 -1
  6. data/lib/flexmock/argument_matchers.rb +5 -5
  7. data/lib/flexmock/argument_types.rb +1 -1
  8. data/lib/flexmock/base.rb +1 -1
  9. data/lib/flexmock/core.rb +5 -5
  10. data/lib/flexmock/core_class_methods.rb +6 -6
  11. data/lib/flexmock/default_framework_adapter.rb +2 -2
  12. data/lib/flexmock/deprecated_methods.rb +1 -1
  13. data/lib/flexmock/errors.rb +1 -1
  14. data/lib/flexmock/expectation.rb +12 -12
  15. data/lib/flexmock/expectation_director.rb +1 -1
  16. data/lib/flexmock/mock_container.rb +12 -2
  17. data/lib/flexmock/noop.rb +2 -2
  18. data/lib/flexmock/ordering.rb +1 -1
  19. data/lib/flexmock/partial_mock.rb +10 -3
  20. data/lib/flexmock/rails.rb +1 -1
  21. data/lib/flexmock/recorder.rb +1 -1
  22. data/lib/flexmock/rspec.rb +1 -1
  23. data/lib/flexmock/test_unit.rb +2 -2
  24. data/lib/flexmock/test_unit_integration.rb +5 -5
  25. data/lib/flexmock/undefined.rb +8 -4
  26. data/lib/flexmock/validators.rb +2 -2
  27. data/lib/flexmock/version.rb +11 -0
  28. data/test/{test_aliasing.rb → aliasing_test.rb} +7 -8
  29. data/test/{test_container_methods.rb → container_methods_test.rb} +21 -22
  30. data/test/{test_default_framework_adapter.rb → default_framework_adapter_test.rb} +8 -9
  31. data/test/{test_demeter_mocking.rb → demeter_mocking_test.rb} +1 -4
  32. data/test/{test_deprecated_methods.rb → deprecated_methods_test.rb} +11 -13
  33. data/test/{test_examples_from_readme.rb → examples_from_readme_test.rb} +5 -6
  34. data/test/{test_extended_should_receive.rb → extended_should_receive_test.rb} +11 -12
  35. data/test/{test_flexmodel.rb → flexmodel_test.rb} +1 -2
  36. data/test/{test_naming.rb → naming_test.rb} +5 -6
  37. data/test/{test_new_instances.rb → new_instances_test.rb} +36 -28
  38. data/test/{test_partial_mock.rb → partial_mock_test.rb} +20 -18
  39. data/test/{test_rails_view_stub.rb → rails_view_stub_test.rb} +3 -3
  40. data/test/{test_record_mode.rb → record_mode_test.rb} +2 -5
  41. data/test/rspec_integration/integration_spec.rb +14 -8
  42. data/test/{test_samples.rb → samples_test.rb} +13 -14
  43. data/test/{test_should_ignore_missing.rb → should_ignore_missing_test.rb} +4 -6
  44. data/test/{test_should_receive.rb → should_receive_test.rb} +39 -42
  45. data/test/test_setup.rb +30 -0
  46. data/test/test_unit_integration/{test_auto_test_unit.rb → auto_test_unit_test.rb} +4 -4
  47. data/test/tu_integration_test.rb +99 -0
  48. data/test/{test_undefined.rb → undefined_test.rb} +2 -3
  49. metadata +31 -39
  50. data/test/asserts.rb +0 -34
  51. data/test/test_tu_integration.rb +0 -94
@@ -3,7 +3,7 @@
3
3
  FlexMock is a simple, but flexible, mock object library for Ruby unit
4
4
  testing.
5
5
 
6
- Version :: 0.8.11
6
+ Version :: 0.9.0.beta.0
7
7
 
8
8
  = Links
9
9
 
@@ -935,7 +935,7 @@ above copyright notice is included.
935
935
  = Other stuff
936
936
 
937
937
  Author:: Jim Weirich <jim@weirichhouse.org>
938
- Requires:: Ruby 1.8.x or later
938
+ Requires:: Ruby 1.8.7 or later (Use Flexmock-0.8.8 for Ruby version 1.8.6)
939
939
 
940
940
  == Warranty
941
941
 
data/Rakefile CHANGED
@@ -10,16 +10,18 @@
10
10
  #+++
11
11
  task :noop
12
12
  require 'rubygems'
13
- require 'rake/gempackagetask'
14
13
  require 'rake/clean'
15
- require 'rake/rdoctask'
16
14
  require 'rake/testtask'
17
15
  require 'rake/contrib/rubyforgepublisher'
18
16
 
17
+ require 'rubygems/package_task'
18
+
19
19
  CLEAN.include('*.tmp')
20
20
  CLOBBER.include("html", 'pkg')
21
21
 
22
- PKG_VERSION = '0.8.11'
22
+ load './lib/flexmock/version.rb'
23
+
24
+ PKG_VERSION = FlexMock::VERSION
23
25
 
24
26
  PKG_FILES = FileList[
25
27
  '[A-Z]*',
@@ -44,13 +46,14 @@ task :ta => [:test_all]
44
46
  # Test Targets -------------------------------------------------------
45
47
 
46
48
  Rake::TestTask.new do |t|
47
- t.pattern = 'test/test*.rb'
49
+ t.test_files = FileList['test/*_test.rb']
50
+ t.libs << "."
48
51
  t.verbose = false
49
52
  t.warning = true
50
53
  end
51
54
 
52
55
  Rake::TestTask.new(:test_extended) do |t|
53
- t.test_files = FileList['test/extended/test_*.rb']
56
+ t.test_files = FileList['test/extended/*_test.rb']
54
57
  t.verbose = true
55
58
  t.warning = true
56
59
  end
@@ -80,21 +83,14 @@ end
80
83
 
81
84
  # RDoc Target --------------------------------------------------------
82
85
 
83
- task :rdoc => ["README.rdoc"]
84
-
85
- $rd = Rake::RDocTask.new("rdoc") do |rdoc|
86
- rdoc.rdoc_dir = 'html'
87
- rdoc.template = 'doc/jamis.rb'
88
- # rdoc.template = 'html'
89
- # rdoc.template = 'kilmer'
90
- # rdoc.template = 'css2'
91
- rdoc.title = "Flex Mock"
92
- rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
93
- rdoc.rdoc_files.include(RDOC_FILES)
86
+ task :rdoc => ["html/index.html"]
87
+
88
+ file "html/index.html" => ["Rakefile"] + RDOC_FILES do
89
+ sh "rdoc -o html --title FlexMock --line-numbers -m README.rdoc #{RDOC_FILES}"
94
90
  end
95
91
 
96
- file "README.rdoc" => ["Rakefile"] do
97
- ruby %{-i.bak -pe 'sub!(/^Version *:: *(\\d+\\.)+\\d+ *$/, "Version :: #{PKG_VERSION}")' README.rdoc} # "
92
+ file "README.rdoc" => ["Rakefile", "lib/flexmock/version.rb"] do
93
+ ruby %{-i.bak -pe '$_.sub!(/^Version *:: *(\\d+\\.)+\\d+ *$/, "Version :: #{PKG_VERSION}")' README.rdoc} # "
98
94
  end
99
95
 
100
96
  # Package Task -------------------------------------------------------
@@ -135,80 +131,42 @@ else
135
131
  #### Documentation and testing.
136
132
 
137
133
  s.has_rdoc = true
138
- s.extra_rdoc_files = $rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
134
+ s.extra_rdoc_files = RDOC_FILES.reject { |fn| fn =~ /\.rb$/ }.to_a
139
135
  s.rdoc_options <<
140
- '--title' << 'Flex Mock' <<
141
- '--main' << 'README' <<
136
+ '--title' << 'FlexMock' <<
137
+ '--main' << 'README.rdoc' <<
142
138
  '--line-numbers'
143
139
 
144
140
  #### Author and project details.
145
141
 
146
142
  s.author = "Jim Weirich"
147
- s.email = "jim@weirichhouse.org"
148
- s.homepage = "http://flexmock.rubyforge.org"
143
+ s.email = "jim.weirich@gmail.com"
144
+ s.homepage = "https://github.com/jimweirich/flexmock"
149
145
  end
150
146
 
151
- Rake::GemPackageTask.new(spec) do |pkg|
147
+ Gem::PackageTask.new(spec) do |pkg|
152
148
  pkg.need_zip = true
153
- pkg.need_tar = true
149
+ pkg.need_tar = false
154
150
  end
155
151
  end
156
152
 
157
- desc "Display a list of all the rubyfiles in the project."
158
- task :rubyfiles do
159
- puts FileList['**/*.rb']
160
- end
161
- task :rf => :rubyfiles
162
-
163
153
  require 'rake/contrib/publisher'
164
154
  require 'rake/contrib/sshpublisher'
165
155
 
166
156
  publisher = Rake::CompositePublisher.new
167
157
  publisher.add(Rake::RubyForgePublisher.new('flexmock', 'jimweirich'))
168
- publisher.add(Rake::SshFreshDirPublisher.new(
169
- 'umlcoop',
170
- 'htdocs/software/flexmock',
171
- 'html'))
172
- publisher.add(Rake::SshFilePublisher.new(
173
- 'umlcoop',
174
- 'htdocs/software/flexmock',
175
- '.',
176
- 'flexmock.blurb'))
177
158
 
178
159
  desc "Publish the documentation on public websites"
179
160
  task :publish => [:rdoc] do
180
161
  publisher.upload
181
162
  end
182
163
 
183
- SVNHOME = 'svn://localhost/software/flexmock'
184
-
185
164
  task :specs do
186
165
  specs = FileList['test/spec_*.rb']
187
166
  ENV['RUBYLIB'] = "lib:test:#{ENV['RUBYLIB']}"
188
- sh %{spec #{specs}}
167
+ sh %{rspec #{specs}}
189
168
  end
190
169
 
191
170
  task :tag do
192
- sh "svn copy #{SVNHOME}/trunk #{SVNHOME}/tags/rel-#{PKG_VERSION} -m 'Release #{PKG_VERSION}'"
171
+ sh "git tag 'flexmock-#{PKG_VERSION}'"
193
172
  end
194
-
195
- RUBY_FILES = FileList['**/*.rb']
196
- RUBY_FILES.exclude(/^pkg/)
197
- task :dbg do
198
- RUBY_FILES.egrep(/DBG/)
199
- end
200
-
201
- # Tagging ------------------------------------------------------------
202
-
203
- # module Tags
204
- # RUBY_FILES = FileList['**/*.rb'].exclude("pkg")
205
- # end
206
-
207
- # namespace "tags" do
208
- # task :emacs => Tags::RUBY_FILES do
209
- # puts "Making Emacs TAGS file"
210
- # sh "xctags -e #{Tags::RUBY_FILES}", :verbose => false
211
- # end
212
- # end
213
-
214
- # task :tags => ["tags:emacs"]
data/TAGS CHANGED
@@ -6,36 +6,36 @@ module PagePage2,12
6
6
  install.rb,29
7
7
  def indir(newdir)indir7,68
8
8
 
9
- lib/flexmock/argument_matchers.rb,723
10
- class FlexMockFlexMock14,338
11
- class AnyMatcherAnyMatcher17,445
12
- def ===(target)===18,464
13
- def inspectinspect21,503
14
- class EqualMatcherEqualMatcher28,655
15
- def initialize(obj)initialize29,676
16
- def ===(target)===32,725
17
- def inspectinspect35,774
18
- class ProcMatcherProcMatcher44,985
19
- def initialize(&block)initialize45,1005
20
- def ===(target)===48,1061
21
- def inspectinspect51,1115
22
- class HashMatcherHashMatcher58,1292
23
- def initialize(hash)initialize59,1312
24
- def ===(target)===62,1364
25
- def inspectinspect65,1435
26
- class DuckMatcherDuckMatcher72,1626
27
- def initialize(methods)initialize73,1646
28
- def ===(target)===76,1707
29
- def inspectinspect79,1785
9
+ lib/flexmock/argument_matchers.rb,722
10
+ class FlexMockFlexMock14,319
11
+ class AnyMatcherAnyMatcher17,426
12
+ def ===(target)===18,445
13
+ def inspectinspect21,484
14
+ class EqualMatcherEqualMatcher28,636
15
+ def initialize(obj)initialize29,657
16
+ def ===(target)===32,706
17
+ def inspectinspect35,755
18
+ class ProcMatcherProcMatcher44,966
19
+ def initialize(&block)initialize45,986
20
+ def ===(target)===48,1042
21
+ def inspectinspect51,1096
22
+ class HashMatcherHashMatcher58,1271
23
+ def initialize(hash)initialize59,1291
24
+ def ===(target)===62,1343
25
+ def inspectinspect65,1414
26
+ class DuckMatcherDuckMatcher72,1603
27
+ def initialize(methods)initialize73,1623
28
+ def ===(target)===76,1684
29
+ def inspectinspect79,1762
30
30
 
31
31
  lib/flexmock/argument_types.rb,228
32
- class FlexMockFlexMock14,350
33
- module ArgumentTypesArgumentTypes21,643
34
- def anyany23,726
35
- def eq(obj)eq29,853
36
- def on(&block)on36,1053
37
- def hsh(hash)hsh42,1194
38
- def ducktype(*methods)ducktype48,1371
32
+ class FlexMockFlexMock14,331
33
+ module ArgumentTypesArgumentTypes21,624
34
+ def anyany23,707
35
+ def eq(obj)eq29,834
36
+ def on(&block)on36,1034
37
+ def hsh(hash)hsh42,1175
38
+ def ducktype(*methods)ducktype48,1352
39
39
 
40
40
  lib/flexmock/base.rb,0
41
41
 
@@ -43,166 +43,166 @@ lib/flexmock/composite.rb,30
43
43
  class FlexMockFlexMock8,133
44
44
 
45
45
  lib/flexmock/core.rb,900
46
- class FlexMockFlexMock46,1290
47
- def initialize(name="unknown", container=nil)initialize55,1560
48
- def inspectinspect65,1854
49
- def flexmock_verifyflexmock_verify71,2014
50
- def flexmock_teardownflexmock_teardown82,2255
51
- def should_ignore_missingshould_ignore_missing86,2335
52
- def by_defaultby_default91,2447
53
- def method_missing(sym, *args, &block)method_missing97,2576
54
- def respond_to?(sym, *args)respond_to?114,3048
55
- def flexmock_find_expectation(method_name, *args) # :nodoc:flexmock_find_expectation119,3204
56
- def flexmock_expectations_for(method_name) # :nodoc:flexmock_expectations_for125,3409
57
- def method(sym)method130,3568
58
- def should_receive(*args)should_receive159,4607
59
- def should_expectshould_expect182,5352
60
- def flexmock_wrap(&block)flexmock_wrap190,5542
61
- def override_existing_method(sym)override_existing_method204,6101
62
- def sclasssclass213,6321
46
+ class FlexMockFlexMock46,1270
47
+ def initialize(name="unknown", container=nil)initialize55,1540
48
+ def inspectinspect65,1834
49
+ def flexmock_verifyflexmock_verify71,1994
50
+ def flexmock_teardownflexmock_teardown82,2235
51
+ def should_ignore_missingshould_ignore_missing86,2315
52
+ def by_defaultby_default91,2427
53
+ def method_missing(sym, *args, &block)method_missing97,2556
54
+ def respond_to?(sym, *args)respond_to?114,3028
55
+ def flexmock_find_expectation(method_name, *args) # :nodoc:flexmock_find_expectation119,3184
56
+ def flexmock_expectations_for(method_name) # :nodoc:flexmock_expectations_for125,3389
57
+ def method(sym)method130,3548
58
+ def should_receive(*args)should_receive159,4587
59
+ def should_expectshould_expect182,5330
60
+ def flexmock_wrap(&block)flexmock_wrap190,5520
61
+ def override_existing_method(sym)override_existing_method204,6075
62
+ def sclasssclass213,6295
63
63
 
64
64
  lib/flexmock/core_class_methods.rb,289
65
- class FlexMockFlexMock15,371
66
- def use(*names)use39,1312
67
- def format_args(sym, args) # :nodoc:format_args53,1710
68
- def check(msg, &block) # :nodoc:check63,2011
69
- class UseContainerUseContainer70,2186
70
- def initializeinitialize75,2276
71
- def passed?passed?79,2337
65
+ class FlexMockFlexMock15,352
66
+ def use(*names)use39,1293
67
+ def format_args(sym, args) # :nodoc:format_args53,1691
68
+ def check(msg, &block) # :nodoc:check63,1992
69
+ class UseContainerUseContainer70,2165
70
+ def initializeinitialize75,2247
71
+ def passed?passed?79,2304
72
72
 
73
73
  lib/flexmock/default_framework_adapter.rb,345
74
- class FlexMockFlexMock14,337
75
- class DefaultFrameworkAdapterDefaultFrameworkAdapter15,352
76
- def assert_block(msg, &block)assert_block16,384
77
- def assert_equal(a, b, msg=nil)assert_equal22,497
78
- class AssertionFailedError < StandardError; endAssertionFailedError26,597
79
- def assertion_failed_errorassertion_failed_error27,649
74
+ class FlexMockFlexMock14,318
75
+ class DefaultFrameworkAdapterDefaultFrameworkAdapter15,333
76
+ def assert_block(msg, &block)assert_block16,365
77
+ def assert_equal(a, b, msg=nil)assert_equal22,478
78
+ class AssertionFailedError < StandardError; endAssertionFailedError26,578
79
+ def assertion_failed_errorassertion_failed_error27,630
80
80
 
81
81
  lib/flexmock/deprecated_methods.rb,340
82
- class ModuleModule13,314
83
- def flexmock_deprecate(*method_names)flexmock_deprecate14,327
84
- class FlexMockFlexMock33,827
85
- def mock_handle(sym, expected_count=nil, &block) # :nodoc:mock_handle40,1125
86
- class PartialMockProxyPartialMockProxy47,1415
87
- def any_instance(&block)any_instance53,1572
88
- module OrderingOrdering59,1720
82
+ class ModuleModule13,295
83
+ def flexmock_deprecate(*method_names)flexmock_deprecate14,308
84
+ class FlexMockFlexMock33,808
85
+ def mock_handle(sym, expected_count=nil, &block) # :nodoc:mock_handle40,1106
86
+ class PartialMockProxyPartialMockProxy47,1396
87
+ def any_instance(&block)any_instance53,1553
88
+ module OrderingOrdering59,1701
89
89
 
90
90
  lib/flexmock/errors.rb,137
91
- class FlexMockFlexMock14,338
92
- class UsageError < ::RuntimeErrorUsageError17,406
93
- class MockError < ::RuntimeErrorMockError20,449
94
-
95
- lib/flexmock/expectation.rb,2060
96
- class FlexMockFlexMock14,337
97
- class ExpectationExpectation28,872
98
- def initialize(mock, sym)initialize34,1018
99
- def to_sto_s49,1380
100
- def verify_call(*args)verify_call55,1562
101
- def _return_value(args) # :nodoc:_return_value64,1782
102
- def return_value(args)return_value69,1922
103
- def perform_yielding(args)perform_yielding83,2253
104
- def eligible?eligible?99,2839
105
- def call_count_constrained?call_count_constrained?104,2988
106
- def validate_ordervalidate_order109,3098
107
- def flexmock_verifyflexmock_verify121,3473
108
- def match_args(args)match_args129,3670
109
- def match_arg(expected, actual)match_arg138,4016
110
- def with(*args)with145,4245
111
- def with_no_argswith_no_args151,4379
112
- def with_any_argswith_any_args157,4512
113
- def and_return(*args, &block)and_return188,5521
114
- def and_return_undefinedand_return_undefined212,6239
115
- def and_yield(*yield_values)and_yield228,6808
116
- def and_raise(exception, *args)and_raise252,7571
117
- def and_throw(sym, value=nil)and_throw266,7936
118
- def zero_or_more_timeszero_or_more_times272,8111
119
- def times(limit)times279,8334
120
- def nevernever288,8681
121
- def onceonce295,8896
122
- def twicetwice302,9111
123
- def at_leastat_least314,9437
124
- def at_mostat_most327,9816
125
- def ordered(group_name=nil)ordered356,11085
126
- def globallyglobally368,11465
127
- def define_ordered(group_name, ordering)define_ordered374,11580
128
- def by_defaultby_default388,12078
129
- class CompositeExpectationCompositeExpectation399,12485
130
- def initializeinitialize402,12559
131
- def add(expectation)add407,12655
132
- def method_missing(sym, *args, &block)method_missing412,12796
133
- def order_numberorder_number423,13175
134
- def mockmock428,13285
135
- def should_receive(*args, &block)should_receive434,13453
136
- def to_sto_s439,13599
137
- class ExpectationRecorderExpectationRecorder453,14057
138
- def initializeinitialize456,14117
139
- def method_missing(sym, *args, &block)method_missing461,14228
140
- def apply(mock)apply469,14504
91
+ class FlexMockFlexMock14,319
92
+ class UsageError < ::RuntimeErrorUsageError17,387
93
+ class MockError < ::RuntimeErrorMockError20,430
94
+
95
+ lib/flexmock/expectation.rb,2059
96
+ class FlexMockFlexMock14,318
97
+ class ExpectationExpectation28,851
98
+ def initialize(mock, sym)initialize34,997
99
+ def to_sto_s49,1359
100
+ def verify_call(*args)verify_call55,1541
101
+ def _return_value(args) # :nodoc:_return_value64,1761
102
+ def return_value(args)return_value69,1901
103
+ def perform_yielding(args)perform_yielding83,2229
104
+ def eligible?eligible?99,2814
105
+ def call_count_constrained?call_count_constrained?104,2963
106
+ def validate_ordervalidate_order109,3067
107
+ def flexmock_verifyflexmock_verify121,3442
108
+ def match_args(args)match_args129,3639
109
+ def match_arg(expected, actual)match_arg138,3985
110
+ def with(*args)with145,4214
111
+ def with_no_argswith_no_args151,4348
112
+ def with_any_argswith_any_args157,4481
113
+ def and_return(*args, &block)and_return188,5490
114
+ def and_return_undefinedand_return_undefined212,6207
115
+ def and_yield(*yield_values)and_yield228,6776
116
+ def and_raise(exception, *args)and_raise252,7529
117
+ def and_throw(sym, value=nil)and_throw266,7894
118
+ def zero_or_more_timeszero_or_more_times272,8069
119
+ def times(limit)times279,8292
120
+ def nevernever288,8639
121
+ def onceonce295,8854
122
+ def twicetwice302,9069
123
+ def at_leastat_least314,9395
124
+ def at_mostat_most327,9774
125
+ def ordered(group_name=nil)ordered356,11043
126
+ def globallyglobally368,11423
127
+ def define_ordered(group_name, ordering)define_ordered374,11538
128
+ def by_defaultby_default388,12036
129
+ class CompositeExpectationCompositeExpectation399,12443
130
+ def initializeinitialize402,12517
131
+ def add(expectation)add407,12613
132
+ def method_missing(sym, *args, &block)method_missing412,12754
133
+ def order_numberorder_number423,13129
134
+ def mockmock428,13239
135
+ def should_receive(*args, &block)should_receive434,13403
136
+ def to_sto_s439,13549
137
+ class ExpectationRecorderExpectationRecorder453,14007
138
+ def initializeinitialize456,14067
139
+ def method_missing(sym, *args, &block)method_missing461,14178
140
+ def apply(mock)apply469,14450
141
141
 
142
142
  lib/flexmock/expectation_director.rb,483
143
- class FlexMockFlexMock15,363
144
- class ExpectationDirectorExpectationDirector20,574
145
- def initialize(sym)initialize23,658
146
- def call(*args)call38,1206
147
- def <<(expectation)<<46,1459
148
- def find_expectation(*args) # :nodoc:find_expectation51,1583
149
- def flexmock_verify # :nodoc:flexmock_verify62,1957
150
- def defaultify_expectation(exp) # :nodoc:defaultify_expectation69,2168
151
- def find_expectation_in(expectations, *args)find_expectation_in81,2449
143
+ class FlexMockFlexMock15,344
144
+ class ExpectationDirectorExpectationDirector20,555
145
+ def initialize(sym)initialize23,639
146
+ def call(*args)call38,1187
147
+ def <<(expectation)<<46,1440
148
+ def find_expectation(*args) # :nodoc:find_expectation51,1564
149
+ def flexmock_verify # :nodoc:flexmock_verify62,1938
150
+ def defaultify_expectation(exp) # :nodoc:defaultify_expectation69,2149
151
+ def find_expectation_in(expectations, *args)find_expectation_in81,2430
152
152
 
153
153
  lib/flexmock/mock_container.rb,944
154
- class FlexMockFlexMock16,399
155
- module MockContainerMockContainer26,805
156
- def flexmock_teardownflexmock_teardown31,989
157
- def flexmock_verifyflexmock_verify38,1147
158
- def flexmock_created_mocksflexmock_created_mocks45,1307
159
- def flexmock_closeflexmock_close51,1531
160
- def flexmock(*args)flexmock119,4763
161
- def flexmock_remember(mocking_object)flexmock_remember161,6039
162
- class MockContainerHelperMockContainerHelper177,6689
163
- def next_idnext_id181,6798
164
- def parse_should_args(mock, args, &block) # :nodoc:parse_should_args194,7271
165
- def add_model_methods(mock, model_class, id)add_model_methods212,7784
166
- def make_partial_proxy(container, obj, name, safe_mode)make_partial_proxy241,9002
167
- def build_demeter_chain(mock, arg, &block)build_demeter_chain286,10855
168
- def check_proper_mock(mock, method_name)check_proper_mock311,11706
169
- def check_method_names(names)check_method_names321,12114
154
+ class FlexMockFlexMock16,380
155
+ module MockContainerMockContainer26,781
156
+ def flexmock_teardownflexmock_teardown31,965
157
+ def flexmock_verifyflexmock_verify40,1208
158
+ def flexmock_created_mocksflexmock_created_mocks49,1448
159
+ def flexmock_closeflexmock_close55,1668
160
+ def flexmock(*args)flexmock123,4876
161
+ def flexmock_remember(mocking_object)flexmock_remember165,6148
162
+ class MockContainerHelperMockContainerHelper181,6798
163
+ def next_idnext_id185,6907
164
+ def parse_should_args(mock, args, &block) # :nodoc:parse_should_args198,7380
165
+ def add_model_methods(mock, model_class, id)add_model_methods216,7893
166
+ def make_partial_proxy(container, obj, name, safe_mode)make_partial_proxy245,9111
167
+ def build_demeter_chain(mock, arg, &block)build_demeter_chain291,11097
168
+ def check_proper_mock(mock, method_name)check_proper_mock316,11944
169
+ def check_method_names(names)check_method_names326,12348
170
170
 
171
171
  lib/flexmock/noop.rb,0
172
172
 
173
173
  lib/flexmock/ordering.rb,399
174
- class FlexMockFlexMock12,312
175
- module OrderingOrdering20,684
176
- def flexmock_allocate_orderflexmock_allocate_order23,751
177
- def flexmock_groupsflexmock_groups29,914
178
- def flexmock_current_orderflexmock_current_order34,1022
179
- def flexmock_current_order=(value)flexmock_current_order=39,1145
180
- def flexmock_validate_order(method_name, order_number)flexmock_validate_order43,1231
174
+ class FlexMockFlexMock12,293
175
+ module OrderingOrdering20,665
176
+ def flexmock_allocate_orderflexmock_allocate_order23,732
177
+ def flexmock_groupsflexmock_groups29,895
178
+ def flexmock_current_orderflexmock_current_order34,1003
179
+ def flexmock_current_order=(value)flexmock_current_order=39,1126
180
+ def flexmock_validate_order(method_name, order_number)flexmock_validate_order43,1212
181
181
 
182
182
  lib/flexmock/partial_mock.rb,1375
183
- class FlexMockFlexMock14,337
184
- class PartialMockProxyPartialMockProxy26,966
185
- def initialize(obj, mock, safe_mode)initialize40,1303
186
- def flexmock_getflexmock_get56,1703
187
- def should_receive(*args)should_receive80,2643
188
- def add_mock_method(method_name)add_mock_method91,2921
189
- def new_instances(*allocators, &block)new_instances123,4137
190
- def invoke_original(method, args)invoke_original144,4938
191
- def flexmock_verifyflexmock_verify152,5232
192
- def flexmock_teardownflexmock_teardown157,5368
193
- def flexmock_containerflexmock_container169,5706
194
- def flexmock_container=(container)flexmock_container=175,5901
195
- def flexmock_expectations_for(method_name)flexmock_expectations_for179,6017
196
- def sclasssclass186,6178
197
- def singleton?(method_name)singleton?192,6319
198
- def hide_existing_method(method_name)hide_existing_method202,6781
199
- def stow_existing_definition(method_name)stow_existing_definition209,6998
200
- def create_alias_for_existing_method(method_name)create_alias_for_existing_method229,7715
201
- def define_proxy_method(method_name)define_proxy_method247,8234
202
- def restore_original_definition(method_name)restore_original_definition268,8932
203
- def remove_current_method(method_name)remove_current_method280,9296
204
- def detached?detached?285,9457
205
- def new_name(old_name)new_name290,9565
183
+ class FlexMockFlexMock14,318
184
+ class PartialMockProxyPartialMockProxy26,948
185
+ def initialize(obj, mock, safe_mode)initialize40,1285
186
+ def flexmock_getflexmock_get56,1685
187
+ def should_receive(*args)should_receive80,2625
188
+ def add_mock_method(method_name)add_mock_method91,2903
189
+ def new_instances(*allocators, &block)new_instances123,4119
190
+ def invoke_original(method, args)invoke_original144,4920
191
+ def flexmock_verifyflexmock_verify152,5214
192
+ def flexmock_teardownflexmock_teardown157,5350
193
+ def flexmock_containerflexmock_container169,5688
194
+ def flexmock_container=(container)flexmock_container=175,5883
195
+ def flexmock_expectations_for(method_name)flexmock_expectations_for179,5999
196
+ def sclasssclass186,6160
197
+ def singleton?(method_name)singleton?192,6301
198
+ def hide_existing_method(method_name)hide_existing_method202,6763
199
+ def stow_existing_definition(method_name)stow_existing_definition209,6980
200
+ def create_alias_for_existing_method(method_name)create_alias_for_existing_method229,7697
201
+ def define_proxy_method(method_name)define_proxy_method247,8216
202
+ def restore_original_definition(method_name)restore_original_definition268,8964
203
+ def remove_current_method(method_name)remove_current_method280,9328
204
+ def detached?detached?285,9489
205
+ def new_name(old_name)new_name290,9597
206
206
 
207
207
  lib/flexmock/rails/view_mocking.rb,665
208
208
  class FlexMockFlexMock3,20
@@ -218,67 +218,59 @@ class FlexMockFlexMock3,20
218
218
  lib/flexmock/rails.rb,0
219
219
 
220
220
  lib/flexmock/recorder.rb,271
221
- class FlexMockFlexMock14,347
222
- class RecorderRecorder20,523
223
- def initialize(mock)initialize24,629
224
- def should_be_strict(is_strict=true)should_be_strict48,1561
225
- def strict?strict?53,1675
226
- def method_missing(sym, *args, &block)method_missing59,1805
221
+ class FlexMockFlexMock14,328
222
+ class RecorderRecorder20,504
223
+ def initialize(mock)initialize24,610
224
+ def should_be_strict(is_strict=true)should_be_strict48,1542
225
+ def strict?strict?53,1656
226
+ def method_missing(sym, *args, &block)method_missing59,1786
227
227
 
228
228
  lib/flexmock/rspec.rb,341
229
- class FlexMockFlexMock14,344
230
- class RSpecFrameworkAdapterRSpecFrameworkAdapter21,441
231
- def assert_block(msg, &block)assert_block22,471
232
- def assert_equal(a, b, msg=nil)assert_equal26,573
233
- class AssertionFailedError < StandardError; endAssertionFailedError31,736
234
- def assertion_failed_errorassertion_failed_error32,788
229
+ class FlexMockFlexMock14,319
230
+ class RSpecFrameworkAdapterRSpecFrameworkAdapter21,416
231
+ def assert_block(msg, &block)assert_block22,446
232
+ def assert_equal(a, b, msg=nil)assert_equal26,548
233
+ class AssertionFailedError < StandardError; endAssertionFailedError31,711
234
+ def assertion_failed_errorassertion_failed_error32,763
235
235
 
236
236
  lib/flexmock/test_unit.rb,120
237
- module TestTest14,354
238
- module UnitUnit15,366
239
- class TestCaseTestCase16,380
240
- def teardownteardown25,695
237
+ module TestTest14,335
238
+ module UnitUnit15,347
239
+ class TestCaseTestCase16,361
240
+ def teardownteardown25,676
241
241
 
242
242
  lib/flexmock/test_unit_integration.rb,227
243
- class FlexMockFlexMock15,357
244
- module TestCaseTestCase29,917
245
- def teardownteardown35,1092
246
- class TestUnitFrameworkAdapterTestUnitFrameworkAdapter45,1301
247
- def assertion_failed_errorassertion_failed_error47,1369
243
+ class FlexMockFlexMock15,338
244
+ module TestCaseTestCase29,895
245
+ def teardownteardown35,1070
246
+ class TestUnitFrameworkAdapterTestUnitFrameworkAdapter45,1277
247
+ def assertion_failed_errorassertion_failed_error47,1345
248
248
 
249
249
  lib/flexmock/undefined.rb,288
250
- class FlexMockFlexMock12,312
251
- class UndefinedUndefined17,483
252
- def method_missing(sym, *args, &block)method_missing18,501
253
- def to_sto_s22,564
254
- def inspectinspect26,606
255
- def cloneclone30,642
256
- def coerce(other)coerce34,680
257
- def self.undefinedundefined43,885
250
+ class FlexMockFlexMock12,293
251
+ class UndefinedUndefined17,464
252
+ def method_missing(sym, *args, &block)method_missing18,482
253
+ def to_sto_s22,545
254
+ def inspectinspect26,587
255
+ def cloneclone30,623
256
+ def coerce(other)coerce34,657
257
+ def self.undefinedundefined43,862
258
258
 
259
259
  lib/flexmock/validators.rb,545
260
- class FlexMockFlexMock14,337
261
- class CountValidatorCountValidator19,473
262
- def initialize(expectation, limit)initialize20,496
263
- def eligible?(n)eligible?28,752
264
- class ExactCountValidator < CountValidatorExactCountValidator36,917
265
- def validate(n)validate39,1041
266
- class AtLeastCountValidator < CountValidatorAtLeastCountValidator48,1332
267
- def validate(n)validate51,1458
268
- def eligible?(n)eligible?61,1875
269
- class AtMostCountValidator < CountValidatorAtMostCountValidator69,2058
270
- def validate(n)validate71,2173
260
+ class FlexMockFlexMock14,318
261
+ class CountValidatorCountValidator19,454
262
+ def initialize(expectation, limit)initialize20,477
263
+ def eligible?(n)eligible?28,733
264
+ class ExactCountValidator < CountValidatorExactCountValidator36,898
265
+ def validate(n)validate39,1022
266
+ class AtLeastCountValidator < CountValidatorAtLeastCountValidator48,1313
267
+ def validate(n)validate51,1439
268
+ def eligible?(n)eligible?61,1856
269
+ class AtMostCountValidator < CountValidatorAtMostCountValidator69,2039
270
+ def validate(n)validate71,2154
271
271
 
272
272
  lib/flexmock.rb,0
273
273
 
274
- print_tree.rb,47
275
- def print_tree(tree, indent=0)print_tree5,44
276
-
277
- test/asserts.rb,139
278
- class FlexMockFlexMock12,312
279
- module FailureAssertionFailureAssertion15,368
280
- def assert_failure(message=nil)assert_failure21,567
281
-
282
274
  test/redirect_error.rb,114
283
275
  class FlexMockFlexMock3,20
284
276
  module RedirectErrorRedirectError4,35
@@ -286,500 +278,506 @@ class FlexMockFlexMock3,20
286
278
 
287
279
  test/rspec_integration/integration_spec.rb,0
288
280
 
289
- test/test_aliasing.rb,522
290
- class FlexMockFlexMock6,61
291
- module StubsAndExpectsStubsAndExpects7,76
292
- def expects(*args)expects8,101
293
- def stubs(*args)stubs13,247
294
- module MockContainerMockContainer18,311
295
- class PartialMockProxyPartialMockProxy25,420
296
- class AliasingTest < Test::Unit::TestCaseAliasingTest31,523
297
- def test_mockingtest_mocking34,595
298
- def test_once_mockingtest_once_mocking40,756
299
- def test_twice_mockingtest_twice_mocking44,854
300
- def test_stubbingtest_stubbing49,1033
301
- def test_partialtest_partial54,1158
281
+ test/test_aliasing.rb,521
282
+ class FlexMockFlexMock5,48
283
+ module StubsAndExpectsStubsAndExpects6,63
284
+ def expects(*args)expects7,88
285
+ def stubs(*args)stubs12,234
286
+ module MockContainerMockContainer17,298
287
+ class PartialMockProxyPartialMockProxy24,407
288
+ class AliasingTest < Test::Unit::TestCaseAliasingTest30,510
289
+ def test_mockingtest_mocking33,582
290
+ def test_once_mockingtest_once_mocking39,741
291
+ def test_twice_mockingtest_twice_mocking43,837
292
+ def test_stubbingtest_stubbing48,1004
293
+ def test_partialtest_partial53,1127
302
294
 
303
295
  test/test_container_methods.rb,1111
304
- class TestFlexmockContainerMethods < Test::Unit::TestCaseTestFlexmockContainerMethods16,410
305
- def test_simple_mock_creationtest_simple_mock_creation19,498
306
- def test_mock_with_nametest_mock_with_name25,639
307
- def test_mock_with_symbol_nametest_mock_with_symbol_name32,848
308
- def test_mock_with_hashtest_mock_with_hash39,1063
309
- def test_mock_with_name_and_hashtest_mock_with_name_and_hash45,1208
310
- def test_mock_with_name_hash_and_blocktest_mock_with_name_hash_and_block54,1516
311
- def test_basic_stubtest_basic_stub62,1739
312
- def test_basic_stub_with_nametest_basic_stub_with_name69,1901
313
- def test_stub_with_quick_definitionstest_stub_with_quick_definitions77,2161
314
- def test_stub_with_name_quick_definitionstest_stub_with_name_quick_definitions83,2305
315
- def test_stubs_are_auto_verifiedtest_stubs_are_auto_verified92,2629
316
- def test_stubbing_a_stringtest_stubbing_a_string99,2831
317
- def test_multiple_stubs_work_with_same_partial_mock_proxytest_multiple_stubs_work_with_same_partial_mock_proxy105,2958
318
- def test_multiple_stubs_layer_behaviortest_multiple_stubs_layer_behavior112,3130
319
-
320
- test/test_default_framework_adapter.rb,475
321
- class TestFlexmockDefaultFrameworkAdapter < Test::Unit::TestCaseTestFlexmockDefaultFrameworkAdapter15,352
322
- def setupsetup16,417
323
- def test_assert_block_raises_exception test_assert_block_raises_exception20,489
324
- def test_assert_block_doesnt_raise_exceptiontest_assert_block_doesnt_raise_exception26,684
325
- def test_assert_equal_doesnt_raise_exceptiontest_assert_equal_doesnt_raise_exception30,794
326
- def test_assert_equal_can_failtest_assert_equal_can_fail34,900
327
-
328
- test/test_demeter_mocking.rb,1569
329
- class TestDemeterMocking < Test::Unit::TestCaseTestDemeterMocking7,84
330
- def test_demeter_mockingtest_demeter_mocking11,199
331
- def test_demeter_mocking_with_operatorstest_demeter_mocking_with_operators19,426
332
- def test_demeter_mocking_with_multiple_operatorstest_demeter_mocking_with_multiple_operators28,715
333
- def test_multiple_demeter_mocks_on_same_branch_is_oktest_multiple_demeter_mocks_on_same_branch_is_ok34,876
334
- def test_multi_level_deep_demeter_violationtest_multi_level_deep_demeter_violation42,1168
335
- def test_final_method_can_have_multiple_expecationstest_final_method_can_have_multiple_expecations48,1353
336
- def test_conflicting_mock_declarations_raises_an_errortest_conflicting_mock_declarations_raises_an_error56,1644
337
- def test_conflicting_mock_declarations_in_reverse_order_does_not_raise_errortest_conflicting_mock_declarations_in_reverse_order_does_not_raise_error68,2049
338
- def test_preestablishing_existing_mock_is_oktest_preestablishing_existing_mock_is_ok78,2393
339
- def test_quick_defs_can_use_demeter_mockingtest_quick_defs_can_use_demeter_mocking86,2656
340
- def test_quick_defs_can_use_demeter_mocking_twotest_quick_defs_can_use_demeter_mocking_two96,2965
341
- def test_errors_on_ill_formed_method_namestest_errors_on_ill_formed_method_names103,3194
342
- def test_no_errors_on_well_formed_method_namestest_no_errors_on_well_formed_method_names112,3448
343
- def test_readme_example_1test_readme_example_1121,3666
344
- def test_readme_example_2test_readme_example_2131,4040
345
- def test_readme_example_3test_readme_example_3137,4241
296
+ class TestFlexmockContainerMethods < Test::Unit::TestCaseTestFlexmockContainerMethods15,378
297
+ def test_simple_mock_creationtest_simple_mock_creation18,466
298
+ def test_mock_with_nametest_mock_with_name24,605
299
+ def test_mock_with_symbol_nametest_mock_with_symbol_name31,802
300
+ def test_mock_with_hashtest_mock_with_hash38,1005
301
+ def test_mock_with_name_and_hashtest_mock_with_name_and_hash44,1148
302
+ def test_mock_with_name_hash_and_blocktest_mock_with_name_hash_and_block53,1444
303
+ def test_basic_stubtest_basic_stub61,1665
304
+ def test_basic_stub_with_nametest_basic_stub_with_name68,1825
305
+ def test_stub_with_quick_definitionstest_stub_with_quick_definitions76,2075
306
+ def test_stub_with_name_quick_definitionstest_stub_with_name_quick_definitions82,2219
307
+ def test_stubs_are_auto_verifiedtest_stubs_are_auto_verified91,2531
308
+ def test_stubbing_a_stringtest_stubbing_a_string98,2721
309
+ def test_multiple_stubs_work_with_same_partial_mock_proxytest_multiple_stubs_work_with_same_partial_mock_proxy104,2846
310
+ def test_multiple_stubs_layer_behaviortest_multiple_stubs_layer_behavior111,3016
311
+
312
+ test/test_default_framework_adapter.rb,473
313
+ class TestFlexmockDefaultFrameworkAdapter < Test::Unit::TestCaseTestFlexmockDefaultFrameworkAdapter14,320
314
+ def setupsetup15,385
315
+ def test_assert_block_raises_exceptiontest_assert_block_raises_exception19,457
316
+ def test_assert_block_doesnt_raise_exceptiontest_assert_block_doesnt_raise_exception25,649
317
+ def test_assert_equal_doesnt_raise_exceptiontest_assert_equal_doesnt_raise_exception29,757
318
+ def test_assert_equal_can_failtest_assert_equal_can_fail33,861
319
+
320
+ test/test_demeter_mocking.rb,1568
321
+ class TestDemeterMocking < Test::Unit::TestCaseTestDemeterMocking5,48
322
+ def test_demeter_mockingtest_demeter_mocking8,126
323
+ def test_demeter_mocking_with_operatorstest_demeter_mocking_with_operators16,353
324
+ def test_demeter_mocking_with_multiple_operatorstest_demeter_mocking_with_multiple_operators25,642
325
+ def test_multiple_demeter_mocks_on_same_branch_is_oktest_multiple_demeter_mocks_on_same_branch_is_ok31,803
326
+ def test_multi_level_deep_demeter_violationtest_multi_level_deep_demeter_violation39,1095
327
+ def test_final_method_can_have_multiple_expecationstest_final_method_can_have_multiple_expecations45,1280
328
+ def test_conflicting_mock_declarations_raises_an_errortest_conflicting_mock_declarations_raises_an_error53,1571
329
+ def test_conflicting_mock_declarations_in_reverse_order_does_not_raise_errortest_conflicting_mock_declarations_in_reverse_order_does_not_raise_error65,1976
330
+ def test_preestablishing_existing_mock_is_oktest_preestablishing_existing_mock_is_ok75,2320
331
+ def test_quick_defs_can_use_demeter_mockingtest_quick_defs_can_use_demeter_mocking83,2583
332
+ def test_quick_defs_can_use_demeter_mocking_twotest_quick_defs_can_use_demeter_mocking_two93,2892
333
+ def test_errors_on_ill_formed_method_namestest_errors_on_ill_formed_method_names100,3121
334
+ def test_no_errors_on_well_formed_method_namestest_no_errors_on_well_formed_method_names109,3375
335
+ def test_readme_example_1test_readme_example_1118,3593
336
+ def test_readme_example_2test_readme_example_2128,3967
337
+ def test_readme_example_3test_readme_example_3134,4168
346
338
 
347
339
  test/test_deprecated_methods.rb,2237
348
- class TestFlexMock < Test::Unit::TestCaseTestFlexMock17,420
349
- def s(&block)s21,526
350
- def setupsetup25,576
351
- def test_handletest_handle29,624
352
- def test_handle_no_blocktest_handle_no_block36,768
353
- def test_called_with_blocktest_called_with_block42,898
354
- def test_return_valuetest_return_value49,1096
355
- def test_handle_missing_methodtest_handle_missing_method54,1201
356
- def test_ignore_missing_methodtest_ignore_missing_method62,1431
357
- def test_good_countstest_good_counts68,1562
358
- def test_bad_countstest_bad_counts76,1701
359
- def test_undetermined_countstest_undetermined_counts87,1918
360
- def test_zero_countstest_zero_counts96,2063
361
- def test_file_io_with_usetest_file_io_with_use105,2242
362
- def count_lines(stream)count_lines113,2446
363
- def test_usetest_use121,2564
364
- def test_failures_during_usetest_failures_during_use130,2721
365
- def test_sequential_valuestest_sequential_values140,2940
366
- def test_respond_to_returns_false_for_non_handled_methodstest_respond_to_returns_false_for_non_handled_methods149,3174
367
- def test_respond_to_returns_true_for_explicit_methodstest_respond_to_returns_true_for_explicit_methods153,3309
368
- def test_respond_to_returns_true_for_missing_methods_when_ignoring_missingtest_respond_to_returns_true_for_missing_methods_when_ignoring_missing158,3468
369
- def test_respond_to_returns_true_for_missing_methods_when_ignoring_missing_using_shouldtest_respond_to_returns_true_for_missing_methods_when_ignoring_missing_using_should163,3649
370
- def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown168,3845
371
- def test_method_returns_callable_proctest_method_returns_callable_proc174,3963
372
- def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods183,4219
373
- class TestDeprecatedOrderingMethods < Test::Unit::TestCaseTestDeprecatedOrderingMethods191,4446
374
- def test_deprecated_ordering_methodstest_deprecated_ordering_methods195,4569
375
- class TestAnyInstance < Test::Unit::TestCaseTestAnyInstance207,4965
376
- class DogDog211,5074
377
- def barkbark212,5086
378
- def test_any_instance_still_works_for_backwards_compatibilitytest_any_instance_still_works_for_backwards_compatibility217,5126
379
-
380
- test/test_examples_from_readme.rb,1207
381
- class TemperatureSamplerTemperatureSampler15,352
382
- def initialize(sensor)initialize16,377
383
- def average_tempaverage_temp20,430
384
- class TestTemperatureSampler < Test::Unit::TestCaseTestTemperatureSampler26,557
385
- def test_tempurature_samplertest_tempurature_sampler29,639
386
- class TestExamplesFromReadme < Test::Unit::TestCaseTestExamplesFromReadme38,918
387
- def test_simple_return_valuestest_simple_return_values41,1000
388
- def test_returning_an_undefined_valuetest_returning_an_undefined_value47,1140
389
- def test_dbtest_db53,1280
390
- def test_query_and_updatetest_query_and_update62,1510
391
- def test_ordered_queriestest_ordered_queries71,1763
392
- def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode89,2362
393
- def test_build_xmltest_build_xml106,2894
394
- def known_good_way_to_build_xml(rec)known_good_way_to_build_xml115,3149
395
- def new_way_to_build_xml(rec)new_way_to_build_xml120,3219
396
- def test_multiple_getstest_multiple_gets124,3307
397
- def test_an_important_messagetest_an_important_message133,3552
398
- class QuoteServiceQuoteService142,3782
399
- class PortfolioPortfolio144,3809
400
- def valuevalue145,3827
401
- def test_portfolio_valuetest_portfolio_value150,3887
402
-
403
- test/test_extended_should_receive.rb,809
404
- module ExtendedShouldReceiveTestsExtendedShouldReceiveTests15,352
405
- def test_accepts_expectation_hashtest_accepts_expectation_hash16,386
406
- def test_accepts_list_of_methodstest_accepts_list_of_methods22,552
407
- def test_contraints_apply_to_all_expectationstest_contraints_apply_to_all_expectations29,712
408
- def test_count_contraints_apply_to_all_expectationstest_count_contraints_apply_to_all_expectations36,1001
409
- def test_multiple_should_receives_are_allowedtest_multiple_should_receives_are_allowed42,1204
410
- class TestExtendedShouldReceiveOnFullMocks < Test::Unit::TestCaseTestExtendedShouldReceiveOnFullMocks50,1421
411
- def setupsetup54,1556
412
- class TestExtendedShouldReceiveOnPartialMockProxies < Test::Unit::TestCaseTestExtendedShouldReceiveOnPartialMockProxies61,1626
413
- def setupsetup65,1770
340
+ class TestFlexMock < Test::Unit::TestCaseTestFlexMock15,358
341
+ def s(&block)s19,464
342
+ def setupsetup23,514
343
+ def test_handletest_handle27,562
344
+ def test_handle_no_blocktest_handle_no_block34,706
345
+ def test_called_with_blocktest_called_with_block40,836
346
+ def test_return_valuetest_return_value47,1034
347
+ def test_handle_missing_methodtest_handle_missing_method52,1139
348
+ def test_ignore_missing_methodtest_ignore_missing_method60,1369
349
+ def test_good_countstest_good_counts66,1500
350
+ def test_bad_countstest_bad_counts74,1639
351
+ def test_undetermined_countstest_undetermined_counts85,1846
352
+ def test_zero_countstest_zero_counts94,1991
353
+ def test_file_io_with_usetest_file_io_with_use103,2160
354
+ def count_lines(stream)count_lines111,2364
355
+ def test_usetest_use119,2478
356
+ def test_failures_during_usetest_failures_during_use128,2625
357
+ def test_sequential_valuestest_sequential_values138,2844
358
+ def test_respond_to_returns_false_for_non_handled_methodstest_respond_to_returns_false_for_non_handled_methods147,3076
359
+ def test_respond_to_returns_true_for_explicit_methodstest_respond_to_returns_true_for_explicit_methods151,3211
360
+ def test_respond_to_returns_true_for_missing_methods_when_ignoring_missingtest_respond_to_returns_true_for_missing_methods_when_ignoring_missing156,3370
361
+ def test_respond_to_returns_true_for_missing_methods_when_ignoring_missing_using_shouldtest_respond_to_returns_true_for_missing_methods_when_ignoring_missing_using_should161,3551
362
+ def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown166,3747
363
+ def test_method_returns_callable_proctest_method_returns_callable_proc172,3865
364
+ def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods181,4121
365
+ class TestDeprecatedOrderingMethods < Test::Unit::TestCaseTestDeprecatedOrderingMethods189,4348
366
+ def test_deprecated_ordering_methodstest_deprecated_ordering_methods193,4471
367
+ class TestAnyInstance < Test::Unit::TestCaseTestAnyInstance205,4867
368
+ class DogDog209,4976
369
+ def barkbark210,4988
370
+ def test_any_instance_still_works_for_backwards_compatibilitytest_any_instance_still_works_for_backwards_compatibility215,5028
371
+
372
+ test/test_examples_from_readme.rb,1206
373
+ class TemperatureSamplerTemperatureSampler14,320
374
+ def initialize(sensor)initialize15,345
375
+ def average_tempaverage_temp19,398
376
+ class TestTemperatureSampler < Test::Unit::TestCaseTestTemperatureSampler25,525
377
+ def test_tempurature_samplertest_tempurature_sampler28,607
378
+ class TestExamplesFromReadme < Test::Unit::TestCaseTestExamplesFromReadme37,886
379
+ def test_simple_return_valuestest_simple_return_values40,968
380
+ def test_returning_an_undefined_valuetest_returning_an_undefined_value46,1108
381
+ def test_dbtest_db52,1246
382
+ def test_query_and_updatetest_query_and_update61,1476
383
+ def test_ordered_queriestest_ordered_queries70,1729
384
+ def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode88,2326
385
+ def test_build_xmltest_build_xml105,2858
386
+ def known_good_way_to_build_xml(rec)known_good_way_to_build_xml114,3113
387
+ def new_way_to_build_xml(rec)new_way_to_build_xml119,3183
388
+ def test_multiple_getstest_multiple_gets123,3271
389
+ def test_an_important_messagetest_an_important_message132,3516
390
+ class QuoteServiceQuoteService141,3746
391
+ class PortfolioPortfolio143,3773
392
+ def valuevalue144,3791
393
+ def test_portfolio_valuetest_portfolio_value149,3849
394
+
395
+ test/test_extended_should_receive.rb,808
396
+ module ExtendedShouldReceiveTestsExtendedShouldReceiveTests14,320
397
+ def test_accepts_expectation_hashtest_accepts_expectation_hash15,354
398
+ def test_accepts_list_of_methodstest_accepts_list_of_methods21,518
399
+ def test_contraints_apply_to_all_expectationstest_contraints_apply_to_all_expectations28,676
400
+ def test_count_contraints_apply_to_all_expectationstest_count_contraints_apply_to_all_expectations35,943
401
+ def test_multiple_should_receives_are_allowedtest_multiple_should_receives_are_allowed41,1134
402
+ class TestExtendedShouldReceiveOnFullMocks < Test::Unit::TestCaseTestExtendedShouldReceiveOnFullMocks49,1351
403
+ def setupsetup53,1484
404
+ class TestExtendedShouldReceiveOnPartialMockProxies < Test::Unit::TestCaseTestExtendedShouldReceiveOnPartialMockProxies60,1554
405
+ def setupsetup64,1696
414
406
 
415
407
  test/test_flexmodel.rb,528
416
- class DummyModelDummyModel6,61
417
- class ChildModel < DummyModelChildModel9,83
418
- class TestFlexModel < Test::Unit::TestCaseTestFlexModel13,189
419
- def test_initial_conditionstest_initial_conditions16,262
420
- def test_classifying_mock_modelstest_classifying_mock_models28,663
421
- def test_mock_models_have_different_idstest_mock_models_have_different_ids38,910
422
- def test_mock_models_can_have_quick_defstest_mock_models_can_have_quick_defs44,1061
423
- def test_mock_models_can_have_blockstest_mock_models_can_have_blocks49,1201
408
+ class DummyModelDummyModel5,48
409
+ class ChildModel < DummyModelChildModel8,70
410
+ class TestFlexModel < Test::Unit::TestCaseTestFlexModel12,176
411
+ def test_initial_conditionstest_initial_conditions15,249
412
+ def test_classifying_mock_modelstest_classifying_mock_models27,650
413
+ def test_mock_models_have_different_idstest_mock_models_have_different_ids37,897
414
+ def test_mock_models_can_have_quick_defstest_mock_models_can_have_quick_defs43,1048
415
+ def test_mock_models_can_have_blockstest_mock_models_can_have_blocks48,1188
424
416
 
425
417
  test/test_naming.rb,816
426
- class TestNaming < Test::Unit::TestCaseTestNaming15,352
427
- def test_nametest_name18,424
428
- def test_name_in_no_handler_found_errortest_name_in_no_handler_found_error23,507
429
- def test_name_in_received_count_errortest_name_in_received_count_error32,733
430
- def test_naming_with_usetest_naming_with_use41,963
431
- def test_naming_with_multiple_mocks_in_usetest_naming_with_multiple_mocks_in_use47,1080
432
- def test_inspect_returns_reasonable_nametest_inspect_returns_reasonable_name54,1268
433
- def test_mock_can_override_inspecttest_mock_can_override_inspect61,1452
434
- class DummyDummy68,1655
435
- def inspectinspect69,1669
436
- def test_partial_mocks_use_original_inspecttest_partial_mocks_use_original_inspect74,1722
437
- def test_partial_mocks_can_override_inspecttest_partial_mocks_can_override_inspect80,1886
418
+ class TestNaming < Test::Unit::TestCaseTestNaming14,320
419
+ def test_nametest_name17,390
420
+ def test_name_in_no_handler_found_errortest_name_in_no_handler_found_error22,473
421
+ def test_name_in_received_count_errortest_name_in_received_count_error31,689
422
+ def test_naming_with_usetest_naming_with_use40,909
423
+ def test_naming_with_multiple_mocks_in_usetest_naming_with_multiple_mocks_in_use46,1026
424
+ def test_inspect_returns_reasonable_nametest_inspect_returns_reasonable_name53,1214
425
+ def test_mock_can_override_inspecttest_mock_can_override_inspect60,1398
426
+ class DummyDummy67,1601
427
+ def inspectinspect68,1615
428
+ def test_partial_mocks_use_original_inspecttest_partial_mocks_use_original_inspect73,1668
429
+ def test_partial_mocks_can_override_inspecttest_partial_mocks_can_override_inspect79,1832
438
430
 
439
431
  test/test_new_instances.rb,2271
440
- class TestNewInstances < Test::Unit::TestCaseTestNewInstances16,382
441
- class DogDog20,494
442
- def barkbark21,506
443
- def wagwag24,539
444
- def self.makemake27,571
445
- class CatCat32,614
446
- def initialize(name, &block)initialize34,648
447
- class ConnectionConnection40,756
448
- def initialize(*args)initialize41,775
449
- def send(args)send44,843
450
- def post(args)post47,887
451
- def test_new_instances_allows_stubbing_of_existing_methodstest_new_instances_allows_stubbing_of_existing_methods52,938
452
- def test_new_instances_stubs_still_have_existing_methodstest_new_instances_stubs_still_have_existing_methods60,1161
453
- def test_new_instances_will_pass_args_to_newtest_new_instances_will_pass_args_to_new68,1376
454
- def test_new_gets_block_after_restubbingtest_new_gets_block_after_restubbing81,1782
455
- def test_new_instances_stub_verification_happens_on_teardowntest_new_instances_stub_verification_happens_on_teardown94,2107
456
- def test_new_instances_reports_error_on_non_classestest_new_instances_reports_error_on_non_classes104,2470
457
- def test_does_not_by_default_stub_objects_created_with_allocatetest_does_not_by_default_stub_objects_created_with_allocate114,2752
458
- def test_can_explicitly_stub_objects_created_with_allocatetest_can_explicitly_stub_objects_created_with_allocate122,2982
459
- def test_can_stub_objects_created_with_arbitrary_class_methodstest_can_stub_objects_created_with_arbitrary_class_methods130,3221
460
- def test_stubbing_arbitrary_class_methods_leaves_new_alonetest_stubbing_arbitrary_class_methods_leaves_new_alone137,3446
461
- def test_stubbing_new_and_allocate_doesnt_double_stub_objects_on_newtest_stubbing_new_and_allocate_doesnt_double_stub_objects_on_new144,3661
462
- def test_blocks_on_new_do_not_have_stubs_installedtest_blocks_on_new_do_not_have_stubs_installed157,4116
463
- def test_new_instances_accept_chained_expectationstest_new_instances_accept_chained_expectations171,4456
464
- def test_fancy_use_of_chained_should_receivedtest_fancy_use_of_chained_should_received179,4728
465
- def test_writable_accessorstest_writable_accessors184,4885
466
- def test_ordering_can_be_specifiedtest_ordering_can_be_specified190,5032
467
- def test_ordering_can_be_specified_in_groupstest_ordering_can_be_specified_in_groups198,5228
432
+ class TestNewInstances < Test::Unit::TestCaseTestNewInstances14,320
433
+ class DogDog18,430
434
+ def barkbark19,442
435
+ def wagwag22,475
436
+ def self.makemake25,507
437
+ class CatCat30,550
438
+ def initialize(name, &block)initialize32,584
439
+ class ConnectionConnection38,690
440
+ def initialize(*args)initialize39,709
441
+ def send(args)send42,777
442
+ def post(args)post45,821
443
+ def test_new_instances_allows_stubbing_of_existing_methodstest_new_instances_allows_stubbing_of_existing_methods50,872
444
+ def test_new_instances_stubs_still_have_existing_methodstest_new_instances_stubs_still_have_existing_methods58,1093
445
+ def test_new_instances_will_pass_args_to_newtest_new_instances_will_pass_args_to_new66,1308
446
+ def test_new_gets_block_after_restubbingtest_new_gets_block_after_restubbing79,1714
447
+ def test_new_instances_stub_verification_happens_on_teardowntest_new_instances_stub_verification_happens_on_teardown92,2035
448
+ def test_new_instances_reports_error_on_non_classestest_new_instances_reports_error_on_non_classes102,2380
449
+ def test_does_not_by_default_stub_objects_created_with_allocatetest_does_not_by_default_stub_objects_created_with_allocate112,2659
450
+ def test_can_explicitly_stub_objects_created_with_allocatetest_can_explicitly_stub_objects_created_with_allocate120,2887
451
+ def test_can_stub_objects_created_with_arbitrary_class_methodstest_can_stub_objects_created_with_arbitrary_class_methods128,3124
452
+ def test_stubbing_arbitrary_class_methods_leaves_new_alonetest_stubbing_arbitrary_class_methods_leaves_new_alone135,3347
453
+ def test_stubbing_new_and_allocate_doesnt_double_stub_objects_on_newtest_stubbing_new_and_allocate_doesnt_double_stub_objects_on_new142,3562
454
+ def test_blocks_on_new_do_not_have_stubs_installedtest_blocks_on_new_do_not_have_stubs_installed155,4015
455
+ def test_new_instances_accept_chained_expectationstest_new_instances_accept_chained_expectations169,4353
456
+ def test_fancy_use_of_chained_should_receivedtest_fancy_use_of_chained_should_received177,4623
457
+ def test_writable_accessorstest_writable_accessors182,4778
458
+ def test_ordering_can_be_specifiedtest_ordering_can_be_specified188,4923
459
+ def test_ordering_can_be_specified_in_groupstest_ordering_can_be_specified_in_groups196,5117
468
460
 
469
461
  test/test_partial_mock.rb,4962
470
- class TestStubbing < Test::Unit::TestCaseTestStubbing16,372
471
- class DogDog19,446
472
- def barkbark20,458
473
- def Dog.createcreate23,491
474
- class DogPlus < DogDogPlus28,540
475
- def should_receiveshould_receive29,562
476
- def new_instancesnew_instances32,611
477
- def by_defaultby_default35,656
478
- def test_stub_command_add_behavior_to_arbitrary_objectstest_stub_command_add_behavior_to_arbitrary_objects40,712
479
- def test_stub_command_can_configure_via_blocktest_stub_command_can_configure_via_block46,898
480
- def test_stubbed_methods_can_take_blockstest_stubbed_methods_can_take_blocks54,1097
481
- def test_multiple_stubs_on_the_same_object_reuse_the_same_partial_mocktest_multiple_stubs_on_the_same_object_reuse_the_same_partial_mock61,1324
482
- def test_multiple_methods_can_be_stubbedtest_multiple_methods_can_be_stubbed66,1473
483
- def test_original_behavior_can_be_restoredtest_original_behavior_can_be_restored74,1727
484
- def test_original_missing_behavior_can_be_restoredtest_original_missing_behavior_can_be_restored84,2064
485
- def test_multiple_stubs_on_single_method_can_be_restored_missing_methodtest_multiple_stubs_on_single_method_can_be_restored_missing_method93,2343
486
- def test_original_behavior_is_restored_when_multiple_methods_are_mockedtest_original_behavior_is_restored_when_multiple_methods_are_mocked104,2754
487
- def test_original_behavior_is_restored_on_class_objectstest_original_behavior_is_restored_on_class_objects113,3083
488
- def test_original_behavior_is_restored_on_singleton_methodstest_original_behavior_is_restored_on_singleton_methods120,3334
489
- def obj.hi() :hello endhi122,3417
490
- def test_original_behavior_is_restored_on_singleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_singleton_methods_with_multiple_stubs130,3613
491
- def obj.hi(n) "hello#{n}" endhi132,3716
492
- def test_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubs142,4037
493
- def test_stubbing_file_shouldnt_break_writingtest_stubbing_file_shouldnt_break_writing158,4531
494
- def test_original_behavior_is_restored_even_when_errorstest_original_behavior_is_restored_even_when_errors174,4970
495
- def m.flexmock_verify() endflexmock_verify182,5289
496
- def test_not_calling_stubbed_method_is_an_errortest_not_calling_stubbed_method_is_an_error185,5328
497
- def test_mock_is_verified_when_the_stub_is_verifiedtest_mock_is_verified_when_the_stub_is_verified194,5557
498
- def test_stub_can_have_explicit_nametest_stub_can_have_explicit_name203,5827
499
- def test_unamed_stub_will_use_default_naming_conventiontest_unamed_stub_will_use_default_naming_convention209,6006
500
- def test_partials_can_be_defined_in_a_blocktest_partials_can_be_defined_in_a_block215,6202
501
- def test_partials_defining_block_return_real_obj_not_proxytest_partials_defining_block_return_real_obj_not_proxy223,6389
502
- def test_partial_mocks_always_return_domain_objecttest_partial_mocks_always_return_domain_object230,6583
503
- def test_domain_objects_do_not_have_mock_methodstest_domain_objects_do_not_have_mock_methods241,6863
504
- def test_partial_mocks_have_mock_methodstest_partial_mocks_have_mock_methods248,7055
505
- def test_partial_mocks_do_not_have_mock_methods_after_teardowntest_partial_mocks_do_not_have_mock_methods_after_teardown256,7251
506
- def test_partial_mocks_with_mock_method_singleton_colision_have_original_defs_restoredtest_partial_mocks_with_mock_method_singleton_colision_have_original_defs_restored265,7501
507
- def dog.mock() :original endmock267,7608
508
- class MockColisionMockColision273,7729
509
- def mockmock274,7750
510
- def test_partial_mocks_with_mock_method_non_singleton_colision_have_original_defs_restoredtest_partial_mocks_with_mock_method_non_singleton_colision_have_original_defs_restored279,7794
511
- def test_safe_partial_mocks_do_not_support_mock_methodstest_safe_partial_mocks_do_not_support_mock_methods286,7998
512
- def test_safe_partial_mocks_require_blocktest_safe_partial_mocks_require_block294,8226
513
- def test_safe_partial_mocks_are_actually_mockedtest_safe_partial_mocks_are_actually_mocked299,8364
514
- def test_should_receive_does_not_override_preexisting_deftest_should_receive_does_not_override_preexisting_def304,8534
515
- def test_should_receive_does_override_should_receive_preexisting_deftest_should_receive_does_override_should_receive_preexisting_def310,8734
516
- class LiarLiar315,8918
517
- def respond_to?(method_name)respond_to?316,8931
518
- def test_liar_actually_liestest_liar_actually_lies326,9100
519
- def test_partial_mock_where_respond_to_is_true_yet_method_is_not_theretest_partial_mock_where_respond_to_is_true_yet_method_is_not_there332,9252
520
- class ValueObjectValueObject343,9681
521
- def initialize(val)initialize346,9723
522
- def ==(other)==350,9773
523
- def test_partial_mocks_in_the_presense_of_equal_definitiontest_partial_mocks_in_the_presense_of_equal_definition355,9830
524
-
525
- test/test_rails_view_stub.rb,1491
526
- module ViewTestsViewTests6,80
527
- def test_view_mocks_as_stubtest_view_mocks_as_stub7,97
528
- def test_fails_if_no_rendertest_fails_if_no_render12,191
529
- def test_view_mocks_with_expectationtest_view_mocks_with_expectation19,335
530
- def test_view_mocks_with_expectation_fails_with_different_templatetest_view_mocks_with_expectation_fails_with_different_template24,439
531
- def test_view_mocks_with_expectation_and_multiple_templatestest_view_mocks_with_expectation_and_multiple_templates32,658
532
- def pretend_to_be_rails_version(version)pretend_to_be_rails_version39,834
533
- class TestRailsViewStubForVersionsUpTo_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsUpTo_1_2_445,1029
534
- def setupsetup49,1147
535
- def render(*names)render56,1376
536
- class TestRailsViewStubForVersionsAfter_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsAfter_1_2_470,1654
537
- def setupsetup74,1773
538
- def render(*names)render82,2046
539
- class TestRailsViewStubForVersionsAfter_2_0_2 < Test::Unit::TestCaseTestRailsViewStubForVersionsAfter_2_0_297,2348
540
- def setupsetup101,2467
541
- def render(*names)render109,2742
542
- class FlexMockFlexMock123,2997
543
- module MockContainerMockContainer124,3012
544
- module RailsRails125,3035
545
- module VERSIONVERSION126,3052
546
- class TestRailsVersion < Test::Unit::TestCaseTestRailsVersion133,3121
547
- def test_rails_version_to_get_code_coveragetest_rails_version_to_get_code_coverage135,3196
548
- module ActionViewActionView142,3294
549
- class BaseBase143,3312
462
+ class TestStubbing < Test::Unit::TestCaseTestStubbing14,320
463
+ class DogDog17,392
464
+ def barkbark18,404
465
+ def Dog.createcreate21,437
466
+ class DogPlus < DogDogPlus26,486
467
+ def should_receiveshould_receive27,508
468
+ def new_instancesnew_instances30,557
469
+ def by_defaultby_default33,602
470
+ def test_stub_command_add_behavior_to_arbitrary_objectstest_stub_command_add_behavior_to_arbitrary_objects38,658
471
+ def test_stub_command_can_configure_via_blocktest_stub_command_can_configure_via_block44,842
472
+ def test_stubbed_methods_can_take_blockstest_stubbed_methods_can_take_blocks52,1039
473
+ def test_multiple_stubs_on_the_same_object_reuse_the_same_partial_mocktest_multiple_stubs_on_the_same_object_reuse_the_same_partial_mock59,1264
474
+ def test_multiple_methods_can_be_stubbedtest_multiple_methods_can_be_stubbed64,1411
475
+ def test_original_behavior_can_be_restoredtest_original_behavior_can_be_restored72,1663
476
+ def test_original_missing_behavior_can_be_restoredtest_original_missing_behavior_can_be_restored82,1998
477
+ def test_multiple_stubs_on_single_method_can_be_restored_missing_methodtest_multiple_stubs_on_single_method_can_be_restored_missing_method91,2277
478
+ def test_original_behavior_is_restored_when_multiple_methods_are_mockedtest_original_behavior_is_restored_when_multiple_methods_are_mocked102,2686
479
+ def test_original_behavior_is_restored_on_class_objectstest_original_behavior_is_restored_on_class_objects111,3015
480
+ def test_original_behavior_is_restored_on_singleton_methodstest_original_behavior_is_restored_on_singleton_methods118,3262
481
+ def obj.hi() :hello endhi120,3345
482
+ def test_original_behavior_is_restored_on_singleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_singleton_methods_with_multiple_stubs128,3541
483
+ def obj.hi(n) "hello#{n}" endhi130,3644
484
+ def test_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubs140,3965
485
+ def test_stubbing_file_shouldnt_break_writingtest_stubbing_file_shouldnt_break_writing156,4459
486
+ def test_original_behavior_is_restored_even_when_errorstest_original_behavior_is_restored_even_when_errors172,4898
487
+ def m.flexmock_verify() endflexmock_verify180,5217
488
+ def test_not_calling_stubbed_method_is_an_errortest_not_calling_stubbed_method_is_an_error183,5256
489
+ def test_mock_is_verified_when_the_stub_is_verifiedtest_mock_is_verified_when_the_stub_is_verified192,5474
490
+ def test_stub_can_have_explicit_nametest_stub_can_have_explicit_name201,5731
491
+ def test_unamed_stub_will_use_default_naming_conventiontest_unamed_stub_will_use_default_naming_convention207,5910
492
+ def test_partials_can_be_defined_in_a_blocktest_partials_can_be_defined_in_a_block213,6106
493
+ def test_partials_defining_block_return_real_obj_not_proxytest_partials_defining_block_return_real_obj_not_proxy221,6293
494
+ def test_partial_mocks_always_return_domain_objecttest_partial_mocks_always_return_domain_object228,6487
495
+ def test_domain_objects_do_not_have_mock_methodstest_domain_objects_do_not_have_mock_methods239,6767
496
+ def test_partial_mocks_have_mock_methodstest_partial_mocks_have_mock_methods246,6959
497
+ def test_partial_mocks_do_not_have_mock_methods_after_teardowntest_partial_mocks_do_not_have_mock_methods_after_teardown254,7155
498
+ def test_partial_mocks_with_mock_method_singleton_colision_have_original_defs_restoredtest_partial_mocks_with_mock_method_singleton_colision_have_original_defs_restored263,7405
499
+ def dog.mock() :original endmock265,7512
500
+ class MockColisionMockColision271,7633
501
+ def mockmock272,7654
502
+ def test_partial_mocks_with_mock_method_non_singleton_colision_have_original_defs_restoredtest_partial_mocks_with_mock_method_non_singleton_colision_have_original_defs_restored277,7698
503
+ def test_safe_partial_mocks_do_not_support_mock_methodstest_safe_partial_mocks_do_not_support_mock_methods284,7902
504
+ def test_safe_partial_mocks_require_blocktest_safe_partial_mocks_require_block292,8130
505
+ def test_safe_partial_mocks_are_actually_mockedtest_safe_partial_mocks_are_actually_mocked297,8268
506
+ def test_should_receive_does_not_override_preexisting_deftest_should_receive_does_not_override_preexisting_def302,8438
507
+ def test_should_receive_does_override_should_receive_preexisting_deftest_should_receive_does_override_should_receive_preexisting_def308,8638
508
+ class LiarLiar313,8822
509
+ def respond_to?(method_name)respond_to?314,8835
510
+ def test_liar_actually_liestest_liar_actually_lies324,9004
511
+ def test_partial_mock_where_respond_to_is_true_yet_method_is_not_theretest_partial_mock_where_respond_to_is_true_yet_method_is_not_there330,9156
512
+ class ValueObjectValueObject341,9585
513
+ def initialize(val)initialize344,9627
514
+ def ==(other)==348,9677
515
+ def test_partial_mocks_in_the_presense_of_equal_definitiontest_partial_mocks_in_the_presense_of_equal_definition353,9734
516
+
517
+ test/test_rails_view_stub.rb,1492
518
+ module ViewTestsViewTests6,86
519
+ def test_view_mocks_as_stubtest_view_mocks_as_stub7,103
520
+ def test_fails_if_no_rendertest_fails_if_no_render12,197
521
+ def test_view_mocks_with_expectationtest_view_mocks_with_expectation19,331
522
+ def test_view_mocks_with_expectation_fails_with_different_templatetest_view_mocks_with_expectation_fails_with_different_template24,435
523
+ def test_view_mocks_with_expectation_and_multiple_templatestest_view_mocks_with_expectation_and_multiple_templates32,644
524
+ def pretend_to_be_rails_version(version)pretend_to_be_rails_version39,820
525
+ class TestRailsViewStubForVersionsUpTo_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsUpTo_1_2_445,1015
526
+ def setupsetup49,1133
527
+ def render(*names)render56,1362
528
+ class TestRailsViewStubForVersionsAfter_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsAfter_1_2_470,1640
529
+ def setupsetup74,1759
530
+ def render(*names)render82,2032
531
+ class TestRailsViewStubForVersionsAfter_2_0_2 < Test::Unit::TestCaseTestRailsViewStubForVersionsAfter_2_0_297,2334
532
+ def setupsetup101,2453
533
+ def render(*names)render109,2728
534
+ class FlexMockFlexMock123,2983
535
+ module MockContainerMockContainer124,2998
536
+ module RailsRails125,3021
537
+ module VERSIONVERSION126,3038
538
+ class TestRailsVersion < Test::Unit::TestCaseTestRailsVersion133,3107
539
+ def test_rails_version_to_get_code_coveragetest_rails_version_to_get_code_coverage135,3182
540
+ module ActionViewActionView142,3280
541
+ class BaseBase143,3298
550
542
 
551
543
  test/test_record_mode.rb,1339
552
- class TestRecordMode < Test::Unit::TestCaseTestRecordMode16,375
553
- def test_recording_mode_workstest_recording_mode_works20,486
554
- def test_arguments_are_passed_to_recording_mode_blocktest_arguments_are_passed_to_recording_mode_block28,660
555
- def test_recording_mode_handles_multiple_returnstest_recording_mode_handles_multiple_returns39,924
556
- def test_recording_mode_does_not_specify_ordertest_recording_mode_does_not_specify_order53,1334
557
- def test_recording_mode_gets_block_args_tootest_recording_mode_gets_block_args_too64,1569
558
- def test_recording_mode_should_validate_args_with_equalstest_recording_mode_should_validate_args_with_equals76,1839
559
- def test_recording_mode_should_allow_arg_contraint_validationtest_recording_mode_should_allow_arg_contraint_validation87,2063
560
- def test_recording_mode_should_handle_multiplicity_contraintstest_recording_mode_should_handle_multiplicity_contraints98,2292
561
- def test_strict_record_mode_requires_exact_argument_matchestest_strict_record_mode_requires_exact_argument_matches110,2547
562
- def test_strict_record_mode_requires_exact_orderingtest_strict_record_mode_requires_exact_ordering122,2815
563
- def test_strict_record_mode_requires_oncetest_strict_record_mode_requires_once136,3106
564
- def test_strict_record_mode_can_not_failtest_strict_record_mode_can_not_fail149,3368
544
+ class TestRecordMode < Test::Unit::TestCaseTestRecordMode14,320
545
+ def test_recording_mode_workstest_recording_mode_works17,394
546
+ def test_arguments_are_passed_to_recording_mode_blocktest_arguments_are_passed_to_recording_mode_block25,568
547
+ def test_recording_mode_handles_multiple_returnstest_recording_mode_handles_multiple_returns36,832
548
+ def test_recording_mode_does_not_specify_ordertest_recording_mode_does_not_specify_order50,1242
549
+ def test_recording_mode_gets_block_args_tootest_recording_mode_gets_block_args_too61,1477
550
+ def test_recording_mode_should_validate_args_with_equalstest_recording_mode_should_validate_args_with_equals73,1747
551
+ def test_recording_mode_should_allow_arg_contraint_validationtest_recording_mode_should_allow_arg_contraint_validation84,1971
552
+ def test_recording_mode_should_handle_multiplicity_contraintstest_recording_mode_should_handle_multiplicity_contraints95,2200
553
+ def test_strict_record_mode_requires_exact_argument_matchestest_strict_record_mode_requires_exact_argument_matches107,2455
554
+ def test_strict_record_mode_requires_exact_orderingtest_strict_record_mode_requires_exact_ordering119,2723
555
+ def test_strict_record_mode_requires_oncetest_strict_record_mode_requires_once133,3014
556
+ def test_strict_record_mode_can_not_failtest_strict_record_mode_can_not_fail146,3276
565
557
 
566
558
  test/test_samples.rb,2164
567
- class TestSamples < Test::Unit::TestCaseTestSamples17,378
568
- def test_file_iotest_file_io25,748
569
- def count_lines(file)count_lines33,999
570
- class TestUndefined < Test::Unit::TestCaseTestUndefined43,1092
571
- def test_undefined_valuestest_undefined_values46,1165
572
- class TestSimple < Test::Unit::TestCaseTestSimple55,1351
573
- def test_simple_mocktest_simple_mock58,1421
574
- class TestDog < Test::Unit::TestCaseTestDog65,1556
575
- def test_dog_wagstest_dog_wags68,1625
576
- class WooferWoofer74,1736
577
- class DogDog77,1754
578
- def initializeinitialize78,1764
579
- def barkbark81,1812
580
- def wagwag84,1846
581
- class TestDogBarking < Test::Unit::TestCaseTestDogBarking89,1878
582
- def setupsetup94,2043
583
- def test_dogtest_dog99,2118
584
- class TestDogBarkingWithNewInstances < Test::Unit::TestCaseTestDogBarkingWithNewInstances105,2249
585
- def setupsetup110,2415
586
- def test_dogtest_dog114,2502
587
- class TestDefaults < Test::Unit::TestCaseTestDefaults120,2636
588
- def setupsetup123,2708
589
- def test_something_where_bark_must_be_called_oncetest_something_where_bark_must_be_called_once128,2837
590
- class TestDemeter < Test::Unit::TestCaseTestDemeter136,3040
591
- def test_manual_mockingtest_manual_mocking138,3110
592
- def test_demetertest_demeter151,3544
593
- class TestDb < Test::Unit::TestCaseTestDb161,3759
594
- def test_dbtest_db164,3825
595
- class TestDb < Test::Unit::TestCaseTestDb175,4030
596
- def test_query_and_updatetest_query_and_update178,4096
597
- def test_ordered_queriestest_ordered_queries189,4383
598
- def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode207,4923
599
- def known_good_way_to_build_xml(builder)known_good_way_to_build_xml224,5400
600
- def new_way_to_build_xml(builder)new_way_to_build_xml228,5467
601
- def test_build_xmltest_build_xml232,5551
602
- class TestMoreSamples < Test::Unit::TestCaseTestMoreSamples243,5813
603
- def test_multiple_getstest_multiple_gets246,5888
604
- def test_an_important_messagetest_an_important_message255,6133
605
- class QuoteServiceQuoteService264,6394
606
- class PortfolioPortfolio267,6422
607
- def initializeinitialize268,6440
608
- def valuevalue271,6507
609
- def test_portfolio_valuetest_portfolio_value276,6563
559
+ class TestSamples < Test::Unit::TestCaseTestSamples16,346
560
+ def test_file_iotest_file_io24,716
561
+ def count_lines(file)count_lines32,967
562
+ class TestUndefined < Test::Unit::TestCaseTestUndefined42,1060
563
+ def test_undefined_valuestest_undefined_values45,1133
564
+ class TestSimple < Test::Unit::TestCaseTestSimple54,1319
565
+ def test_simple_mocktest_simple_mock57,1389
566
+ class TestDog < Test::Unit::TestCaseTestDog64,1524
567
+ def test_dog_wagstest_dog_wags67,1591
568
+ class WooferWoofer73,1702
569
+ class DogDog76,1720
570
+ def initializeinitialize77,1730
571
+ def barkbark80,1778
572
+ def wagwag83,1812
573
+ class TestDogBarking < Test::Unit::TestCaseTestDogBarking88,1844
574
+ def setupsetup93,2006
575
+ def test_dogtest_dog98,2079
576
+ class TestDogBarkingWithNewInstances < Test::Unit::TestCaseTestDogBarkingWithNewInstances104,2210
577
+ def setupsetup109,2374
578
+ def test_dogtest_dog113,2459
579
+ class TestDefaults < Test::Unit::TestCaseTestDefaults119,2593
580
+ def setupsetup122,2665
581
+ def test_something_where_bark_must_be_called_oncetest_something_where_bark_must_be_called_once127,2792
582
+ class TestDemeter < Test::Unit::TestCaseTestDemeter135,2994
583
+ def test_manual_mockingtest_manual_mocking137,3064
584
+ def test_demetertest_demeter150,3498
585
+ class TestDb < Test::Unit::TestCaseTestDb160,3713
586
+ def test_dbtest_db163,3779
587
+ class TestDb < Test::Unit::TestCaseTestDb174,3984
588
+ def test_query_and_updatetest_query_and_update177,4050
589
+ def test_ordered_queriestest_ordered_queries188,4327
590
+ def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode206,4867
591
+ def known_good_way_to_build_xml(builder)known_good_way_to_build_xml223,5342
592
+ def new_way_to_build_xml(builder)new_way_to_build_xml227,5409
593
+ def test_build_xmltest_build_xml231,5493
594
+ class TestMoreSamples < Test::Unit::TestCaseTestMoreSamples242,5753
595
+ def test_multiple_getstest_multiple_gets245,5828
596
+ def test_an_important_messagetest_an_important_message254,6073
597
+ class QuoteServiceQuoteService263,6334
598
+ class PortfolioPortfolio266,6362
599
+ def initializeinitialize267,6380
600
+ def valuevalue270,6447
601
+ def test_portfolio_valuetest_portfolio_value275,6503
602
+
603
+ test/test_setup.rb,180
604
+ class FlexMockFlexMock7,91
605
+ module TestCaseTestCase8,106
606
+ def assertion_failed_errorassertion_failed_error9,124
607
+ def assert_failure(message=nil)assert_failure16,378
610
608
 
611
609
  test/test_should_ignore_missing.rb,1173
612
- class TestShouldIgnoreMissing < Test::Unit::TestCaseTestShouldIgnoreMissing16,375
613
- def setupsetup19,458
614
- def test_mocks_do_not_respond_to_undefined_methodstest_mocks_do_not_respond_to_undefined_methods23,508
615
- def test_mocks_do_respond_to_defined_methodstest_mocks_do_respond_to_defined_methods27,612
616
- def test_mocks_do_respond_to_any_method_when_ignoring_missingtest_mocks_do_respond_to_any_method_when_ignoring_missing32,752
617
- def test_ignored_methods_return_undefinedtest_ignored_methods_return_undefined37,898
618
- def test_undefined_mocking_with_argumentstest_undefined_mocking_with_arguments43,1072
619
- def test_method_chains_with_undefined_are_self_preservingtest_method_chains_with_undefined_are_self_preserving48,1220
620
- def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown53,1385
621
- def test_method_returns_callable_proctest_method_returns_callable_proc59,1509
622
- def test_not_calling_method_proc_will_fail_count_constraintstest_not_calling_method_proc_will_fail_count_constraints66,1693
623
- def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods75,1965
624
-
625
- test/test_should_receive.rb,11022
626
- def mock_top_level_functionmock_top_level_function16,375
627
- module KernelKernel20,416
628
- def mock_kernel_functionmock_kernel_function21,430
629
- class CatCat27,496
630
- def purrpurr28,506
631
- def meowmeow30,523
632
- class TestFlexMockShoulds < Test::Unit::TestCaseTestFlexMockShoulds34,545
633
- def test_defaultstest_defaults46,1089
634
- def test_returns_with_valuetest_returns_with_value55,1257
635
- def test_returns_with_multiple_valuestest_returns_with_multiple_values63,1426
636
- def test_multiple_returnstest_multiple_returns74,1686
637
- def test_returns_with_blocktest_returns_with_block85,1946
638
- def test_block_example_from_readmetest_block_example_from_readme94,2149
639
- def test_return_with_and_without_block_interleavedtest_return_with_and_without_block_interleaved104,2445
640
- def test_and_returns_aliastest_and_returns_alias114,2725
641
- def test_and_return_undefinedtest_and_return_undefined121,2862
642
- def test_and_yield_will_continue_to_yield_the_same_valuetest_and_yield_will_continue_to_yield_the_same_value131,3211
643
- def test_and_yield_with_multiple_values_yields_the_valuestest_and_yield_with_multiple_values_yields_the_values139,3457
644
- def test_multiple_yields_are_done_sequentiallytest_multiple_yields_are_done_sequentially146,3667
645
- def test_failure_if_no_block_giventest_failure_if_no_block_given155,3939
646
- def test_failure_different_return_value_than_yield_returntest_failure_different_return_value_than_yield_return162,4122
647
- def test_multiple_yieldstest_multiple_yields171,4408
648
- def test_multiple_yields_will_yield_the_last_value_settest_multiple_yields_will_yield_the_last_value_set179,4646
649
- def test_yielding_then_not_yielding_and_then_yielding_againtest_yielding_then_not_yielding_and_then_yielding_again190,5023
650
- def test_yields_syntaxtest_yields_syntax201,5370
651
- class MyError < RuntimeErrorMyError208,5515
652
- def test_and_raises_with_exception_class_throws_exceptiontest_and_raises_with_exception_class_throws_exception211,5553
653
- def test_and_raises_with_arguments_throws_exception_made_with_argstest_and_raises_with_arguments_throws_exception_made_with_args220,5762
654
- def test_and_raises_with_a_specific_exception_throws_the_exceptiontest_and_raises_with_a_specific_exception_throws_the_exception230,6043
655
- def test_raises_is_an_alias_for_and_raisetest_raises_is_an_alias_for_and_raise241,6313
656
- def test_multiple_and_raise_clauses_will_be_done_sequentiallytest_multiple_and_raise_clauses_will_be_done_sequentially250,6518
657
- def test_and_throw_will_throw_a_symboltest_and_throw_will_throw_a_symbol262,6916
658
- def test_and_throw_with_expression_will_throwtest_and_throw_with_expression_will_throw273,7159
659
- def test_throws_is_an_alias_for_and_throwtest_throws_is_an_alias_for_and_throw284,7441
660
- def test_multiple_throws_will_be_done_sequentiallytest_multiple_throws_will_be_done_sequentially295,7716
661
- def test_multiple_expectationstest_multiple_expectations307,8046
662
- def test_with_no_args_with_no_argstest_with_no_args_with_no_args317,8283
663
- def test_with_no_args_but_with_argstest_with_no_args_but_with_args324,8411
664
- def test_with_any_argstest_with_any_args333,8610
665
- def test_with_any_single_arg_matchingtest_with_any_single_arg_matching343,8788
666
- def test_with_any_single_arg_nonmatchingtest_with_any_single_arg_nonmatching351,8981
667
- def test_with_equal_arg_matchingtest_with_equal_arg_matching361,9216
668
- def test_with_ducktype_arg_matchingtest_with_ducktype_arg_matching368,9379
669
- def test_with_ducktype_arg_matching_no_matchtest_with_ducktype_arg_matching_no_match375,9558
670
- def test_with_hash_matchingtest_with_hash_matching384,9782
671
- def test_with_hash_non_matchingtest_with_hash_non_matching391,9970
672
- def test_with_equal_arg_nonmatchingtest_with_equal_arg_nonmatching400,10190
673
- def test_with_arbitrary_arg_matchingtest_with_arbitrary_arg_matching409,10427
674
- def test_args_matching_with_regextest_args_matching_with_regex424,10847
675
- def test_arg_matching_with_regex_matching_non_stringtest_arg_matching_with_regex_matching_non_string436,11174
676
- def test_arg_matching_with_classtest_arg_matching_with_class443,11351
677
- def test_arg_matching_with_no_matchtest_arg_matching_with_no_match454,11641
678
- def test_arg_matching_with_string_doesnt_over_matchtest_arg_matching_with_string_doesnt_over_match463,11854
679
- def test_block_arg_given_to_no_argstest_block_arg_given_to_no_args472,12073
680
- def test_block_arg_given_to_matching_proctest_block_arg_given_to_matching_proc481,12277
681
- def test_arg_matching_precedence_when_best_firsttest_arg_matching_precedence_when_best_first492,12562
682
- def test_arg_matching_precedence_when_best_last_but_still_matches_firsttest_arg_matching_precedence_when_best_last_but_still_matches_first500,12771
683
- def test_never_and_never_calledtest_never_and_never_called508,13003
684
- def test_never_and_called_oncetest_never_and_called_once514,13118
685
- def test_once_called_oncetest_once_called_once523,13314
686
- def test_once_but_never_calledtest_once_but_never_called530,13448
687
- def test_once_but_called_twicetest_once_but_called_twice538,13635
688
- def test_twice_and_called_twicetest_twice_and_called_twice548,13854
689
- def test_zero_or_more_called_zerotest_zero_or_more_called_zero556,14009
690
- def test_zero_or_more_called_oncetest_zero_or_more_called_once562,14131
691
- def test_zero_or_more_called_100test_zero_or_more_called_100569,14264
692
- def test_timestest_times576,14410
693
- def test_at_least_called_oncetest_at_least_called_once583,14551
694
- def test_at_least_but_never_calledtest_at_least_but_never_called590,14698
695
- def test_at_least_once_but_called_twicetest_at_least_once_but_called_twice598,14901
696
- def test_at_least_and_exacttest_at_least_and_exact606,15072
697
- def test_at_most_but_never_calledtest_at_most_but_never_called616,15302
698
- def test_at_most_called_oncetest_at_most_called_once622,15438
699
- def test_at_most_called_twicetest_at_most_called_twice629,15583
700
- def test_at_most_and_at_least_called_nevertest_at_most_and_at_least_called_never639,15811
701
- def test_at_most_and_at_least_called_oncetest_at_most_and_at_least_called_once647,16036
702
- def test_at_most_and_at_least_called_twicetest_at_most_and_at_least_called_twice654,16209
703
- def test_at_most_and_at_least_called_three_timestest_at_most_and_at_least_called_three_times662,16397
704
- def test_call_counts_only_apply_to_matching_argstest_call_counts_only_apply_to_matching_args673,16675
705
- def test_call_counts_only_apply_to_matching_args_with_mismatchtest_call_counts_only_apply_to_matching_args_with_mismatch685,16953
706
- def test_ordered_calls_in_order_will_passtest_ordered_calls_in_order_will_pass701,17386
707
- def test_ordered_calls_out_of_order_will_failtest_ordered_calls_out_of_order_will_fail711,17568
708
- def test_order_calls_with_different_arg_lists_and_in_order_will_passtest_order_calls_with_different_arg_lists_and_in_order_will_pass723,17829
709
- def test_order_calls_with_different_arg_lists_and_out_of_order_will_failtest_order_calls_with_different_arg_lists_and_out_of_order_will_fail733,18082
710
- def test_unordered_calls_do_not_effect_ordered_testingtest_unordered_calls_do_not_effect_ordered_testing745,18408
711
- def test_ordered_with_multiple_calls_will_passtest_ordered_with_multiple_calls_will_pass759,18678
712
- def test_grouped_ordering_with_numberstest_grouped_ordering_with_numbers771,18893
713
- def test_grouped_ordering_with_symbolstest_grouped_ordering_with_symbols786,19214
714
- def test_explicit_ordering_mixed_with_implicit_ordering_should_not_overlaptest_explicit_ordering_mixed_with_implicit_ordering_should_not_overlap801,19576
715
- def test_explicit_ordering_with_explicit_misorderstest_explicit_ordering_with_explicit_misorders811,19949
716
- def test_ordering_with_explicit_no_args_matches_correctlytest_ordering_with_explicit_no_args_matches_correctly827,20480
717
- def test_ordering_with_any_arg_matching_correctly_matchestest_ordering_with_any_arg_matching_correctly_matches839,20857
718
- def test_ordering_between_mocks_is_not_normally_definedtest_ordering_between_mocks_is_not_normally_defined850,21169
719
- def test_ordering_between_mocks_is_honored_for_global_orderingtest_ordering_between_mocks_is_honored_for_global_ordering862,21425
720
- def test_expectation_formatingtest_expectation_formating874,21743
721
- def test_multi_expectation_formattingtest_multi_expectation_formatting883,21971
722
- def test_explicit_ordering_with_limits_allow_multiple_return_valuestest_explicit_ordering_with_limits_allow_multiple_return_values889,22134
723
- def test_global_methods_can_be_mockedtest_global_methods_can_be_mocked908,22845
724
- def test_kernel_methods_can_be_mockedtest_kernel_methods_can_be_mocked914,23029
725
- def test_undefing_kernel_methods_dont_effect_other_mockstest_undefing_kernel_methods_dont_effect_other_mocks920,23207
726
- def test_expectations_can_by_marked_as_defaulttest_expectations_can_by_marked_as_default928,23475
727
- def test_default_expectations_are_search_in_the_proper_ordertest_default_expectations_are_search_in_the_proper_order934,23641
728
- def test_expectations_with_count_constraints_can_by_marked_as_defaulttest_expectations_with_count_constraints_can_by_marked_as_default942,23948
729
- def test_default_expectations_are_overridden_by_later_expectationstest_default_expectations_are_overridden_by_later_expectations950,24194
730
- def test_default_expectations_can_be_changed_by_later_expectationstest_default_expectations_can_be_changed_by_later_expectations958,24422
731
- def test_ordered_default_expectations_can_be_specifiedtest_ordered_default_expectations_can_be_specified969,24794
732
- def test_ordered_default_expectations_can_be_overriddentest_ordered_default_expectations_can_be_overridden977,25045
733
- def test_by_default_works_at_mock_leveltest_by_default_works_at_mock_level989,25316
734
- def test_by_default_at_mock_level_does_nothing_with_no_expectationstest_by_default_at_mock_level_does_nothing_with_no_expectations1000,25591
735
- def test_partial_mocks_can_have_default_expectationstest_partial_mocks_can_have_default_expectations1006,25736
736
- def test_partial_mocks_can_have_default_expectations_overriddentest_partial_mocks_can_have_default_expectations_overridden1012,25917
737
- def test_wicked_and_evil_tricks_with_by_default_are_thwartedtest_wicked_and_evil_tricks_with_by_default_are_thwarted1019,26165
738
- def test_mocks_can_handle_multi_parameter_respond_tostest_mocks_can_handle_multi_parameter_respond_tos1031,26570
739
- def test_can_mock_operatorstest_can_mock_operators1042,26917
740
- def assert_operator(op, &block)assert_operator1072,27985
741
- class TestFlexMockShouldsWithInclude < Test::Unit::TestCaseTestFlexMockShouldsWithInclude1080,28139
742
- def test_include_enables_unqualified_arg_type_referencestest_include_enables_unqualified_arg_type_references1082,28233
743
- class TestFlexMockArgTypesDontLeak < Test::Unit::TestCaseTestFlexMockArgTypesDontLeak1090,28397
744
- def test_unqualified_arg_type_references_are_undefined_by_defaulttest_unqualified_arg_type_references_are_undefined_by_default1091,28455
610
+ class TestShouldIgnoreMissing < Test::Unit::TestCaseTestShouldIgnoreMissing14,320
611
+ def setupsetup17,403
612
+ def test_mocks_do_not_respond_to_undefined_methodstest_mocks_do_not_respond_to_undefined_methods21,451
613
+ def test_mocks_do_respond_to_defined_methodstest_mocks_do_respond_to_defined_methods25,555
614
+ def test_mocks_do_respond_to_any_method_when_ignoring_missingtest_mocks_do_respond_to_any_method_when_ignoring_missing30,695
615
+ def test_ignored_methods_return_undefinedtest_ignored_methods_return_undefined35,841
616
+ def test_undefined_mocking_with_argumentstest_undefined_mocking_with_arguments41,1015
617
+ def test_method_chains_with_undefined_are_self_preservingtest_method_chains_with_undefined_are_self_preserving46,1163
618
+ def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown51,1328
619
+ def test_method_returns_callable_proctest_method_returns_callable_proc57,1452
620
+ def test_not_calling_method_proc_will_fail_count_constraintstest_not_calling_method_proc_will_fail_count_constraints64,1636
621
+ def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods73,1898
622
+
623
+ test/test_should_receive.rb,11020
624
+ def mock_top_level_functionmock_top_level_function14,320
625
+ module KernelKernel18,361
626
+ def mock_kernel_functionmock_kernel_function19,375
627
+ class CatCat25,441
628
+ def purrpurr26,451
629
+ def meowmeow28,468
630
+ class TestFlexMockShoulds < Test::Unit::TestCaseTestFlexMockShoulds32,490
631
+ def test_defaultstest_defaults43,995
632
+ def test_returns_with_valuetest_returns_with_value52,1163
633
+ def test_returns_with_multiple_valuestest_returns_with_multiple_values60,1330
634
+ def test_multiple_returnstest_multiple_returns71,1590
635
+ def test_returns_with_blocktest_returns_with_block82,1850
636
+ def test_block_example_from_readmetest_block_example_from_readme91,2053
637
+ def test_return_with_and_without_block_interleavedtest_return_with_and_without_block_interleaved101,2349
638
+ def test_and_returns_aliastest_and_returns_alias111,2629
639
+ def test_and_return_undefinedtest_and_return_undefined118,2766
640
+ def test_and_yield_will_continue_to_yield_the_same_valuetest_and_yield_will_continue_to_yield_the_same_value128,3115
641
+ def test_and_yield_with_multiple_values_yields_the_valuestest_and_yield_with_multiple_values_yields_the_values136,3361
642
+ def test_multiple_yields_are_done_sequentiallytest_multiple_yields_are_done_sequentially143,3571
643
+ def test_failure_if_no_block_giventest_failure_if_no_block_given152,3843
644
+ def test_failure_different_return_value_than_yield_returntest_failure_different_return_value_than_yield_return159,4026
645
+ def test_multiple_yieldstest_multiple_yields168,4312
646
+ def test_multiple_yields_will_yield_the_last_value_settest_multiple_yields_will_yield_the_last_value_set176,4550
647
+ def test_yielding_then_not_yielding_and_then_yielding_againtest_yielding_then_not_yielding_and_then_yielding_again187,4927
648
+ def test_yields_syntaxtest_yields_syntax198,5274
649
+ class MyError < RuntimeErrorMyError205,5419
650
+ def test_and_raises_with_exception_class_throws_exceptiontest_and_raises_with_exception_class_throws_exception208,5457
651
+ def test_and_raises_with_arguments_throws_exception_made_with_argstest_and_raises_with_arguments_throws_exception_made_with_args217,5666
652
+ def test_and_raises_with_a_specific_exception_throws_the_exceptiontest_and_raises_with_a_specific_exception_throws_the_exception227,5947
653
+ def test_raises_is_an_alias_for_and_raisetest_raises_is_an_alias_for_and_raise238,6217
654
+ def test_multiple_and_raise_clauses_will_be_done_sequentiallytest_multiple_and_raise_clauses_will_be_done_sequentially247,6422
655
+ def test_and_throw_will_throw_a_symboltest_and_throw_will_throw_a_symbol259,6820
656
+ def test_and_throw_with_expression_will_throwtest_and_throw_with_expression_will_throw270,7063
657
+ def test_throws_is_an_alias_for_and_throwtest_throws_is_an_alias_for_and_throw281,7345
658
+ def test_multiple_throws_will_be_done_sequentiallytest_multiple_throws_will_be_done_sequentially292,7620
659
+ def test_multiple_expectationstest_multiple_expectations304,7950
660
+ def test_with_no_args_with_no_argstest_with_no_args_with_no_args314,8181
661
+ def test_with_no_args_but_with_argstest_with_no_args_but_with_args321,8309
662
+ def test_with_any_argstest_with_any_args330,8508
663
+ def test_with_any_single_arg_matchingtest_with_any_single_arg_matching340,8686
664
+ def test_with_any_single_arg_nonmatchingtest_with_any_single_arg_nonmatching348,8879
665
+ def test_with_equal_arg_matchingtest_with_equal_arg_matching358,9114
666
+ def test_with_ducktype_arg_matchingtest_with_ducktype_arg_matching365,9277
667
+ def test_with_ducktype_arg_matching_no_matchtest_with_ducktype_arg_matching_no_match372,9456
668
+ def test_with_hash_matchingtest_with_hash_matching381,9680
669
+ def test_with_hash_non_matchingtest_with_hash_non_matching388,9868
670
+ def test_with_equal_arg_nonmatchingtest_with_equal_arg_nonmatching397,10088
671
+ def test_with_arbitrary_arg_matchingtest_with_arbitrary_arg_matching406,10325
672
+ def test_args_matching_with_regextest_args_matching_with_regex421,10745
673
+ def test_arg_matching_with_regex_matching_non_stringtest_arg_matching_with_regex_matching_non_string433,11066
674
+ def test_arg_matching_with_classtest_arg_matching_with_class440,11243
675
+ def test_arg_matching_with_no_matchtest_arg_matching_with_no_match451,11527
676
+ def test_arg_matching_with_string_doesnt_over_matchtest_arg_matching_with_string_doesnt_over_match460,11740
677
+ def test_block_arg_given_to_no_argstest_block_arg_given_to_no_args469,11959
678
+ def test_block_arg_given_to_matching_proctest_block_arg_given_to_matching_proc478,12163
679
+ def test_arg_matching_precedence_when_best_firsttest_arg_matching_precedence_when_best_first489,12448
680
+ def test_arg_matching_precedence_when_best_last_but_still_matches_firsttest_arg_matching_precedence_when_best_last_but_still_matches_first497,12657
681
+ def test_never_and_never_calledtest_never_and_never_called505,12889
682
+ def test_never_and_called_oncetest_never_and_called_once511,13004
683
+ def test_once_called_oncetest_once_called_once520,13196
684
+ def test_once_but_never_calledtest_once_but_never_called527,13330
685
+ def test_once_but_called_twicetest_once_but_called_twice535,13517
686
+ def test_twice_and_called_twicetest_twice_and_called_twice545,13736
687
+ def test_zero_or_more_called_zerotest_zero_or_more_called_zero553,13891
688
+ def test_zero_or_more_called_oncetest_zero_or_more_called_once559,14013
689
+ def test_zero_or_more_called_100test_zero_or_more_called_100566,14146
690
+ def test_timestest_times573,14292
691
+ def test_at_least_called_oncetest_at_least_called_once580,14433
692
+ def test_at_least_but_never_calledtest_at_least_but_never_called587,14580
693
+ def test_at_least_once_but_called_twicetest_at_least_once_but_called_twice595,14783
694
+ def test_at_least_and_exacttest_at_least_and_exact603,14954
695
+ def test_at_most_but_never_calledtest_at_most_but_never_called613,15184
696
+ def test_at_most_called_oncetest_at_most_called_once619,15320
697
+ def test_at_most_called_twicetest_at_most_called_twice626,15465
698
+ def test_at_most_and_at_least_called_nevertest_at_most_and_at_least_called_never636,15693
699
+ def test_at_most_and_at_least_called_oncetest_at_most_and_at_least_called_once644,15918
700
+ def test_at_most_and_at_least_called_twicetest_at_most_and_at_least_called_twice651,16091
701
+ def test_at_most_and_at_least_called_three_timestest_at_most_and_at_least_called_three_times659,16279
702
+ def test_call_counts_only_apply_to_matching_argstest_call_counts_only_apply_to_matching_args670,16557
703
+ def test_call_counts_only_apply_to_matching_args_with_mismatchtest_call_counts_only_apply_to_matching_args_with_mismatch682,16835
704
+ def test_ordered_calls_in_order_will_passtest_ordered_calls_in_order_will_pass698,17268
705
+ def test_ordered_calls_out_of_order_will_failtest_ordered_calls_out_of_order_will_fail708,17450
706
+ def test_order_calls_with_different_arg_lists_and_in_order_will_passtest_order_calls_with_different_arg_lists_and_in_order_will_pass720,17711
707
+ def test_order_calls_with_different_arg_lists_and_out_of_order_will_failtest_order_calls_with_different_arg_lists_and_out_of_order_will_fail730,17958
708
+ def test_unordered_calls_do_not_effect_ordered_testingtest_unordered_calls_do_not_effect_ordered_testing742,18284
709
+ def test_ordered_with_multiple_calls_will_passtest_ordered_with_multiple_calls_will_pass756,18548
710
+ def test_grouped_ordering_with_numberstest_grouped_ordering_with_numbers768,18757
711
+ def test_grouped_ordering_with_symbolstest_grouped_ordering_with_symbols783,19072
712
+ def test_explicit_ordering_mixed_with_implicit_ordering_should_not_overlaptest_explicit_ordering_mixed_with_implicit_ordering_should_not_overlap798,19428
713
+ def test_explicit_ordering_with_explicit_misorderstest_explicit_ordering_with_explicit_misorders808,19801
714
+ def test_ordering_with_explicit_no_args_matches_correctlytest_ordering_with_explicit_no_args_matches_correctly824,20329
715
+ def test_ordering_with_any_arg_matching_correctly_matchestest_ordering_with_any_arg_matching_correctly_matches836,20702
716
+ def test_ordering_between_mocks_is_not_normally_definedtest_ordering_between_mocks_is_not_normally_defined847,21010
717
+ def test_ordering_between_mocks_is_honored_for_global_orderingtest_ordering_between_mocks_is_honored_for_global_ordering859,21264
718
+ def test_expectation_formatingtest_expectation_formating871,21573
719
+ def test_multi_expectation_formattingtest_multi_expectation_formatting880,21801
720
+ def test_explicit_ordering_with_limits_allow_multiple_return_valuestest_explicit_ordering_with_limits_allow_multiple_return_values886,21964
721
+ def test_global_methods_can_be_mockedtest_global_methods_can_be_mocked905,22675
722
+ def test_kernel_methods_can_be_mockedtest_kernel_methods_can_be_mocked911,22859
723
+ def test_undefing_kernel_methods_dont_effect_other_mockstest_undefing_kernel_methods_dont_effect_other_mocks917,23037
724
+ def test_expectations_can_by_marked_as_defaulttest_expectations_can_by_marked_as_default925,23305
725
+ def test_default_expectations_are_search_in_the_proper_ordertest_default_expectations_are_search_in_the_proper_order931,23467
726
+ def test_expectations_with_count_constraints_can_by_marked_as_defaulttest_expectations_with_count_constraints_can_by_marked_as_default939,23770
727
+ def test_default_expectations_are_overridden_by_later_expectationstest_default_expectations_are_overridden_by_later_expectations947,24006
728
+ def test_default_expectations_can_be_changed_by_later_expectationstest_default_expectations_can_be_changed_by_later_expectations955,24234
729
+ def test_ordered_default_expectations_can_be_specifiedtest_ordered_default_expectations_can_be_specified966,24596
730
+ def test_ordered_default_expectations_can_be_overriddentest_ordered_default_expectations_can_be_overridden974,24837
731
+ def test_by_default_works_at_mock_leveltest_by_default_works_at_mock_level986,25108
732
+ def test_by_default_at_mock_level_does_nothing_with_no_expectationstest_by_default_at_mock_level_does_nothing_with_no_expectations997,25383
733
+ def test_partial_mocks_can_have_default_expectationstest_partial_mocks_can_have_default_expectations1003,25528
734
+ def test_partial_mocks_can_have_default_expectations_overriddentest_partial_mocks_can_have_default_expectations_overridden1009,25709
735
+ def test_wicked_and_evil_tricks_with_by_default_are_thwartedtest_wicked_and_evil_tricks_with_by_default_are_thwarted1016,25957
736
+ def test_mocks_can_handle_multi_parameter_respond_tostest_mocks_can_handle_multi_parameter_respond_tos1028,26362
737
+ def test_can_mock_operatorstest_can_mock_operators1039,26709
738
+ def assert_operator(op, &block)assert_operator1069,27773
739
+ class TestFlexMockShouldsWithInclude < Test::Unit::TestCaseTestFlexMockShouldsWithInclude1077,27927
740
+ def test_include_enables_unqualified_arg_type_referencestest_include_enables_unqualified_arg_type_references1079,28021
741
+ class TestFlexMockArgTypesDontLeak < Test::Unit::TestCaseTestFlexMockArgTypesDontLeak1087,28185
742
+ def test_unqualified_arg_type_references_are_undefined_by_defaulttest_unqualified_arg_type_references_are_undefined_by_default1088,28243
745
743
 
746
744
  test/test_tu_integration.rb,1570
747
- class TestTuIntegrationFlexMockMethod < Test::Unit::TestCaseTestTuIntegrationFlexMockMethod15,352
748
- def test_can_construct_flexmocktest_can_construct_flexmock18,445
749
- def test_can_construct_flexmock_with_blocktest_can_construct_flexmock_with_block24,594
750
- class TestTuIntegrationMockVerificationInTeardown < Test::Unit::TestCaseTestTuIntegrationMockVerificationInTeardown32,770
751
- def teardownteardown35,873
752
- def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown41,969
753
- class TestTuIntegrationMockVerificationWithoutSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationWithoutSetup46,1087
754
- def teardownteardown49,1192
755
- def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown55,1288
756
- class TestTuIntegrationMockVerificationForgetfulSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationForgetfulSetup60,1406
757
- def teardownteardown63,1513
758
- def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown69,1609
759
- class TestTuIntegrationSetupOverridenAndNoMocksOk < Test::Unit::TestCaseTestTuIntegrationSetupOverridenAndNoMocksOk74,1727
760
- def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown77,1830
761
- class TestTuIntegrationFailurePreventsVerification < Test::Unit::TestCaseTestTuIntegrationFailurePreventsVerification81,1893
762
- def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown84,1997
763
- def simulate_failuresimulate_failure91,2131
745
+ class TestTuIntegrationFlexMockMethod < Test::Unit::TestCaseTestTuIntegrationFlexMockMethod14,320
746
+ def test_can_construct_flexmocktest_can_construct_flexmock17,411
747
+ def test_can_construct_flexmock_with_blocktest_can_construct_flexmock_with_block23,558
748
+ class TestTuIntegrationMockVerificationInTeardown < Test::Unit::TestCaseTestTuIntegrationMockVerificationInTeardown31,734
749
+ def teardownteardown34,837
750
+ def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown40,923
751
+ class TestTuIntegrationMockVerificationWithoutSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationWithoutSetup45,1041
752
+ def teardownteardown48,1146
753
+ def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown54,1232
754
+ class TestTuIntegrationMockVerificationForgetfulSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationForgetfulSetup59,1350
755
+ def teardownteardown62,1457
756
+ def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown68,1543
757
+ class TestTuIntegrationSetupOverridenAndNoMocksOk < Test::Unit::TestCaseTestTuIntegrationSetupOverridenAndNoMocksOk73,1661
758
+ def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown76,1764
759
+ class TestTuIntegrationFailurePreventsVerification < Test::Unit::TestCaseTestTuIntegrationFailurePreventsVerification80,1827
760
+ def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown83,1931
761
+ def simulate_failuresimulate_failure90,2065
764
762
 
765
763
  test/test_undefined.rb,873
766
- class UndefinedTest < Test::Unit::TestCaseUndefinedTest15,352
767
- def test_undefined_method_calls_return_undefinedtest_undefined_method_calls_return_undefined16,395
768
- def test_equalstest_equals20,513
769
- def test_math_operatorstest_math_operators25,611
770
- def test_math_operators_reversedtest_math_operators_reversed33,820
771
- def test_comparisonstest_comparisons41,1038
772
- def test_comparisons_reversedtest_comparisons_reversed49,1247
773
- def test_base_level_methodstest_base_level_methods57,1465
774
- def test_cant_create_a_new_undefinedtest_cant_create_a_new_undefined61,1552
775
- def test_cant_clone_undefinedtest_cant_clone_undefined65,1662
776
- def test_string_representationstest_string_representations70,1796
777
- def test_undefined_is_not_niltest_undefined_is_not_nil75,1934
778
- def assert_undefined(obj)assert_undefined81,2012
779
- def undefinedundefined85,2075
764
+ class UndefinedTest < Test::Unit::TestCaseUndefinedTest14,320
765
+ def test_undefined_method_calls_return_undefinedtest_undefined_method_calls_return_undefined15,363
766
+ def test_equalstest_equals19,481
767
+ def test_math_operatorstest_math_operators24,579
768
+ def test_math_operators_reversedtest_math_operators_reversed32,788
769
+ def test_comparisonstest_comparisons40,1006
770
+ def test_comparisons_reversedtest_comparisons_reversed48,1215
771
+ def test_base_level_methodstest_base_level_methods56,1433
772
+ def test_cant_create_a_new_undefinedtest_cant_create_a_new_undefined60,1520
773
+ def test_cant_clone_undefinedtest_cant_clone_undefined64,1630
774
+ def test_string_representationstest_string_representations69,1764
775
+ def test_undefined_is_not_niltest_undefined_is_not_nil74,1902
776
+ def assert_undefined(obj)assert_undefined80,1980
777
+ def undefinedundefined84,2043
780
778
 
781
779
  test/test_unit_integration/test_auto_test_unit.rb,263
782
- class TestFlexmockTestUnit < Test::Unit::TestCaseTestFlexmockTestUnit17,387
783
- def teardownteardown18,437
784
- def test_can_create_mockstest_can_create_mocks23,496
785
- def test_should_fail__mocks_are_auto_verifiedtest_should_fail__mocks_are_auto_verified30,641
780
+ class TestFlexmockTestUnit < Test::Unit::TestCaseTestFlexmockTestUnit17,374
781
+ def teardownteardown18,424
782
+ def test_can_create_mockstest_can_create_mocks23,483
783
+ def test_should_fail__mocks_are_auto_verifiedtest_should_fail__mocks_are_auto_verified30,626