flexmock 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/Rakefile +1 -1
- data/doc/releases/flexmock-0.8.2.rdoc +100 -0
- data/lib/flexmock/partial_mock.rb +1 -0
- data/test/test_partial_mock.rb +6 -2
- metadata +4 -3
- data/TAGS +0 -748
data/README
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
= Flex Mock -- Making Mock Easy
|
2
2
|
|
3
3
|
FlexMock is a simple, but flexible, mock object library for Ruby unit
|
4
4
|
testing.
|
5
5
|
|
6
|
-
Version :: 0.8.
|
6
|
+
Version :: 0.8.2
|
7
7
|
|
8
8
|
= Links
|
9
9
|
|
@@ -90,8 +90,8 @@ will be able to say:
|
|
90
90
|
config.mock_with :flexmock
|
91
91
|
end
|
92
92
|
|
93
|
-
|
94
|
-
|
93
|
+
describe "Using FlexMock with RSpec" do
|
94
|
+
it "should be able to create a mock" do
|
95
95
|
m = flexmock(:foo => :bar)
|
96
96
|
m.foo.should === :bar
|
97
97
|
end
|
data/Rakefile
CHANGED
@@ -0,0 +1,100 @@
|
|
1
|
+
= FlexMock 0.8.2 Released
|
2
|
+
|
3
|
+
FlexMock is a flexible mocking library for use in unit testing and
|
4
|
+
behavior specification in Ruby. Release 0.8.2 is a minor release with
|
5
|
+
a few bug fixes.
|
6
|
+
|
7
|
+
== Bug Fixes in 0.8.2
|
8
|
+
|
9
|
+
* FlexMock partial mocks will now override any preexisting definitions
|
10
|
+
for "should_receive". Previously, FlexMock would honor preexisting
|
11
|
+
defintions, but an RSpec on Rails bug loads the RSpec mocks, even
|
12
|
+
when other mock libraries are configured. This allows flexmock to
|
13
|
+
correctly use partial mocks in the presence of an ill-behaved mock
|
14
|
+
library.
|
15
|
+
|
16
|
+
* View Stubbing has been updated to work with Rails 2.0.2.
|
17
|
+
|
18
|
+
== What is FlexMock?
|
19
|
+
|
20
|
+
FlexMock is a flexible framework for creating mock object for testing. When
|
21
|
+
running unit tests, it is often desirable to use isolate the objects being
|
22
|
+
tested from the "real world" by having them interact with simplified test
|
23
|
+
objects. Sometimes these test objects simply return values when called, other
|
24
|
+
times they verify that certain methods were called with particular arguments
|
25
|
+
in a particular order.
|
26
|
+
|
27
|
+
FlexMock makes creating these test objects easy.
|
28
|
+
|
29
|
+
=== Features
|
30
|
+
|
31
|
+
* Easy integration with both Test::Unit and RSpec. Mocks created with the
|
32
|
+
flexmock method are automatically verified at the end of the test or
|
33
|
+
example.
|
34
|
+
|
35
|
+
* A fluent interface that allows mock behavior to be specified very
|
36
|
+
easily.
|
37
|
+
|
38
|
+
* A "record mode" where an existing implementation can record its
|
39
|
+
interaction with a mock for later validation against a new
|
40
|
+
implementation.
|
41
|
+
|
42
|
+
* Easy mocking of individual methods in existing, non-mock objects.
|
43
|
+
|
44
|
+
* Easy mocking of chains of method calls.
|
45
|
+
|
46
|
+
* The ability to cause classes to instantiate test instances (instead of real
|
47
|
+
instances) for the duration of a test.
|
48
|
+
|
49
|
+
=== Example
|
50
|
+
|
51
|
+
Suppose you had a Dog object that wagged a tail when it was happy.
|
52
|
+
Something like this:
|
53
|
+
|
54
|
+
class Dog
|
55
|
+
def initialize(a_tail)
|
56
|
+
@tail = a_tail
|
57
|
+
end
|
58
|
+
def happy
|
59
|
+
@tail.wag
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
To test the +Dog+ class without a real +Tail+ object (perhaps because
|
64
|
+
real +Tail+ objects activate servos in some robotic equipment), you
|
65
|
+
can do something like this:
|
66
|
+
|
67
|
+
require 'test/unit'
|
68
|
+
require 'flexmock/test_unit'
|
69
|
+
|
70
|
+
class TestDog < Test::Unit::TestCase
|
71
|
+
def test_dog_wags_tail_when_happy
|
72
|
+
tail = flexmock("tail")
|
73
|
+
tail.should_receive(:wag).once
|
74
|
+
dog = Dog.new(tail)
|
75
|
+
dog.happy
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
FlexMock will automatically verify that the mocked tail object received the
|
80
|
+
message +wag+ exactly one time. If it doesn't, the test will not pass.
|
81
|
+
|
82
|
+
See the FlexMock documentation at http://flexmock.rubyforge.org for details on
|
83
|
+
specifying arguments and return values on mocked methods, as well as a simple
|
84
|
+
technique for mocking tail objects when the Dog class creates the tail objects
|
85
|
+
directly.
|
86
|
+
|
87
|
+
== Availability
|
88
|
+
|
89
|
+
You can make sure you have the latest version with a quick RubyGems command:
|
90
|
+
|
91
|
+
gem install flexmock (you may need root/admin privileges)
|
92
|
+
|
93
|
+
Otherwise, you can get it from the more traditional places:
|
94
|
+
|
95
|
+
Download:: http://rubyforge.org/project/showfiles.php?group_id=170
|
96
|
+
|
97
|
+
You will find documentation at: http://flexmock.rubyforge.org.
|
98
|
+
|
99
|
+
-- Jim Weirich
|
100
|
+
|
data/test/test_partial_mock.rb
CHANGED
@@ -303,11 +303,15 @@ class TestStubbing < Test::Unit::TestCase
|
|
303
303
|
|
304
304
|
def test_should_receive_does_not_override_preexisting_def
|
305
305
|
dog = flexmock(DogPlus.new)
|
306
|
-
assert_equal :dog_should, dog.should_receive
|
307
306
|
assert_equal :dog_new, dog.new_instances
|
308
307
|
assert_equal :dog_by_default, dog.by_default
|
309
308
|
end
|
310
309
|
|
310
|
+
def test_should_receive_does_override_should_receive_preexisting_def
|
311
|
+
dog = flexmock(DogPlus.new)
|
312
|
+
assert_kind_of FlexMock::CompositeExpectation, dog.should_receive(:x)
|
313
|
+
end
|
314
|
+
|
311
315
|
class Liar
|
312
316
|
def respond_to?(method_name)
|
313
317
|
sym = method_name.to_sym
|
@@ -353,5 +357,5 @@ class TestStubbing < Test::Unit::TestCase
|
|
353
357
|
obj = ValueObject.new(:bar)
|
354
358
|
flexmock(obj, :some_method => :some_method)
|
355
359
|
end
|
356
|
-
|
360
|
+
|
357
361
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-23 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -37,11 +37,11 @@ extra_rdoc_files:
|
|
37
37
|
- doc/releases/flexmock-0.7.0.rdoc
|
38
38
|
- doc/releases/flexmock-0.7.1.rdoc
|
39
39
|
- doc/releases/flexmock-0.8.0.rdoc
|
40
|
+
- doc/releases/flexmock-0.8.2.rdoc
|
40
41
|
files:
|
41
42
|
- CHANGES
|
42
43
|
- Rakefile
|
43
44
|
- README
|
44
|
-
- TAGS
|
45
45
|
- lib/flexmock/argument_matchers.rb
|
46
46
|
- lib/flexmock/argument_types.rb
|
47
47
|
- lib/flexmock/base.rb
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- doc/releases/flexmock-0.7.0.rdoc
|
106
106
|
- doc/releases/flexmock-0.7.1.rdoc
|
107
107
|
- doc/releases/flexmock-0.8.0.rdoc
|
108
|
+
- doc/releases/flexmock-0.8.2.rdoc
|
108
109
|
has_rdoc: true
|
109
110
|
homepage: http://onestepback.org/software/flexmock
|
110
111
|
post_install_message:
|
data/TAGS
DELETED
@@ -1,748 +0,0 @@
|
|
1
|
-
|
2
|
-
doc/jamis.rb,43
|
3
|
-
module RDocRDoc1,0
|
4
|
-
module PagePage2,12
|
5
|
-
|
6
|
-
install.rb,29
|
7
|
-
def indir(newdir)indir7,68
|
8
|
-
|
9
|
-
lib/flexmock/argument_matchers.rb,424
|
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
|
-
|
23
|
-
lib/flexmock/argument_types.rb,154
|
24
|
-
class FlexMockFlexMock14,350
|
25
|
-
module ArgumentTypesArgumentTypes21,643
|
26
|
-
def anyany23,726
|
27
|
-
def eq(obj)eq29,853
|
28
|
-
def on(&block)on36,1053
|
29
|
-
|
30
|
-
lib/flexmock/base.rb,0
|
31
|
-
|
32
|
-
lib/flexmock/composite.rb,30
|
33
|
-
class FlexMockFlexMock8,133
|
34
|
-
|
35
|
-
lib/flexmock/core.rb,900
|
36
|
-
class FlexMockFlexMock46,1290
|
37
|
-
def initialize(name="unknown", container=nil)initialize55,1560
|
38
|
-
def inspectinspect65,1854
|
39
|
-
def flexmock_verifyflexmock_verify71,2014
|
40
|
-
def flexmock_teardownflexmock_teardown82,2255
|
41
|
-
def should_ignore_missingshould_ignore_missing86,2335
|
42
|
-
def by_defaultby_default91,2447
|
43
|
-
def method_missing(sym, *args, &block)method_missing97,2576
|
44
|
-
def respond_to?(sym, *args)respond_to?114,3048
|
45
|
-
def flexmock_find_expectation(method_name, *args) # :nodoc:flexmock_find_expectation119,3204
|
46
|
-
def flexmock_expectations_for(method_name) # :nodoc:flexmock_expectations_for125,3409
|
47
|
-
def method(sym)method130,3568
|
48
|
-
def should_receive(*args)should_receive159,4607
|
49
|
-
def should_expectshould_expect182,5352
|
50
|
-
def flexmock_wrap(&block)flexmock_wrap190,5542
|
51
|
-
def override_existing_method(sym)override_existing_method204,6101
|
52
|
-
def sclasssclass213,6321
|
53
|
-
|
54
|
-
lib/flexmock/core_class_methods.rb,289
|
55
|
-
class FlexMockFlexMock15,371
|
56
|
-
def use(*names)use39,1312
|
57
|
-
def format_args(sym, args) # :nodoc:format_args53,1710
|
58
|
-
def check(msg, &block) # :nodoc:check63,2011
|
59
|
-
class UseContainerUseContainer70,2186
|
60
|
-
def initializeinitialize75,2276
|
61
|
-
def passed?passed?79,2337
|
62
|
-
|
63
|
-
lib/flexmock/default_framework_adapter.rb,345
|
64
|
-
class FlexMockFlexMock14,337
|
65
|
-
class DefaultFrameworkAdapterDefaultFrameworkAdapter15,352
|
66
|
-
def assert_block(msg, &block)assert_block16,384
|
67
|
-
def assert_equal(a, b, msg=nil)assert_equal22,497
|
68
|
-
class AssertionFailedError < StandardError; endAssertionFailedError26,597
|
69
|
-
def assertion_failed_errorassertion_failed_error27,649
|
70
|
-
|
71
|
-
lib/flexmock/deprecated_methods.rb,340
|
72
|
-
class ModuleModule13,314
|
73
|
-
def flexmock_deprecate(*method_names)flexmock_deprecate14,327
|
74
|
-
class FlexMockFlexMock33,827
|
75
|
-
def mock_handle(sym, expected_count=nil, &block) # :nodoc:mock_handle40,1125
|
76
|
-
class PartialMockProxyPartialMockProxy47,1415
|
77
|
-
def any_instance(&block)any_instance53,1572
|
78
|
-
module OrderingOrdering59,1720
|
79
|
-
|
80
|
-
lib/flexmock/errors.rb,137
|
81
|
-
class FlexMockFlexMock14,338
|
82
|
-
class UsageError < ::RuntimeErrorUsageError17,406
|
83
|
-
class MockError < ::RuntimeErrorMockError20,449
|
84
|
-
|
85
|
-
lib/flexmock/expectation.rb,2060
|
86
|
-
class FlexMockFlexMock14,337
|
87
|
-
class ExpectationExpectation28,872
|
88
|
-
def initialize(mock, sym)initialize34,1018
|
89
|
-
def to_sto_s49,1380
|
90
|
-
def verify_call(*args)verify_call55,1562
|
91
|
-
def _return_value(args) # :nodoc:_return_value64,1782
|
92
|
-
def return_value(args)return_value69,1922
|
93
|
-
def perform_yielding(args)perform_yielding83,2253
|
94
|
-
def eligible?eligible?99,2839
|
95
|
-
def call_count_constrained?call_count_constrained?104,2988
|
96
|
-
def validate_ordervalidate_order109,3098
|
97
|
-
def flexmock_verifyflexmock_verify121,3473
|
98
|
-
def match_args(args)match_args129,3670
|
99
|
-
def match_arg(expected, actual)match_arg138,4016
|
100
|
-
def with(*args)with145,4245
|
101
|
-
def with_no_argswith_no_args151,4379
|
102
|
-
def with_any_argswith_any_args157,4512
|
103
|
-
def and_return(*args, &block)and_return188,5521
|
104
|
-
def and_return_undefinedand_return_undefined212,6239
|
105
|
-
def and_yield(*yield_values)and_yield228,6808
|
106
|
-
def and_raise(exception, *args)and_raise252,7571
|
107
|
-
def and_throw(sym, value=nil)and_throw266,7936
|
108
|
-
def zero_or_more_timeszero_or_more_times272,8111
|
109
|
-
def times(limit)times279,8334
|
110
|
-
def nevernever288,8681
|
111
|
-
def onceonce295,8896
|
112
|
-
def twicetwice302,9111
|
113
|
-
def at_leastat_least314,9437
|
114
|
-
def at_mostat_most327,9816
|
115
|
-
def ordered(group_name=nil)ordered356,11085
|
116
|
-
def globallyglobally368,11465
|
117
|
-
def define_ordered(group_name, ordering)define_ordered374,11580
|
118
|
-
def by_defaultby_default388,12078
|
119
|
-
class CompositeExpectationCompositeExpectation399,12485
|
120
|
-
def initializeinitialize402,12559
|
121
|
-
def add(expectation)add407,12655
|
122
|
-
def method_missing(sym, *args, &block)method_missing412,12796
|
123
|
-
def order_numberorder_number423,13175
|
124
|
-
def mockmock428,13285
|
125
|
-
def should_receive(*args, &block)should_receive434,13453
|
126
|
-
def to_sto_s439,13599
|
127
|
-
class ExpectationRecorderExpectationRecorder453,14057
|
128
|
-
def initializeinitialize456,14117
|
129
|
-
def method_missing(sym, *args, &block)method_missing461,14228
|
130
|
-
def apply(mock)apply469,14504
|
131
|
-
|
132
|
-
lib/flexmock/expectation_director.rb,483
|
133
|
-
class FlexMockFlexMock15,363
|
134
|
-
class ExpectationDirectorExpectationDirector20,574
|
135
|
-
def initialize(sym)initialize23,658
|
136
|
-
def call(*args)call38,1207
|
137
|
-
def <<(expectation)<<46,1460
|
138
|
-
def find_expectation(*args) # :nodoc:find_expectation51,1584
|
139
|
-
def flexmock_verify # :nodoc:flexmock_verify59,1909
|
140
|
-
def defaultify_expectation(exp) # :nodoc:defaultify_expectation66,2120
|
141
|
-
def find_expectation_in(expectations, *args)find_expectation_in78,2401
|
142
|
-
|
143
|
-
lib/flexmock/mock_container.rb,882
|
144
|
-
class FlexMockFlexMock15,371
|
145
|
-
module MockContainerMockContainer25,777
|
146
|
-
def flexmock_teardownflexmock_teardown30,961
|
147
|
-
def flexmock_verifyflexmock_verify37,1119
|
148
|
-
def flexmock_closeflexmock_close46,1414
|
149
|
-
def flexmock(*args)flexmock115,4684
|
150
|
-
def flexmock_remember(mocking_object)flexmock_remember157,5960
|
151
|
-
class MockContainerHelperMockContainerHelper173,6610
|
152
|
-
def next_idnext_id177,6719
|
153
|
-
def parse_should_args(mock, args, &block) # :nodoc:parse_should_args190,7192
|
154
|
-
def add_model_methods(mock, model_class, id)add_model_methods208,7705
|
155
|
-
def make_partial_proxy(container, obj, name, safe_mode)make_partial_proxy232,8564
|
156
|
-
def build_demeter_chain(mock, arg, &block)build_demeter_chain277,10417
|
157
|
-
def check_proper_mock(mock, method_name)check_proper_mock302,11268
|
158
|
-
def check_method_names(names)check_method_names312,11675
|
159
|
-
|
160
|
-
lib/flexmock/noop.rb,0
|
161
|
-
|
162
|
-
lib/flexmock/ordering.rb,399
|
163
|
-
class FlexMockFlexMock12,312
|
164
|
-
module OrderingOrdering20,684
|
165
|
-
def flexmock_allocate_orderflexmock_allocate_order23,751
|
166
|
-
def flexmock_groupsflexmock_groups29,914
|
167
|
-
def flexmock_current_orderflexmock_current_order34,1022
|
168
|
-
def flexmock_current_order=(value)flexmock_current_order=39,1145
|
169
|
-
def flexmock_validate_order(method_name, order_number)flexmock_validate_order43,1231
|
170
|
-
|
171
|
-
lib/flexmock/partial_mock.rb,1380
|
172
|
-
class FlexMockFlexMock14,337
|
173
|
-
class PartialMockProxyPartialMockProxy26,968
|
174
|
-
def initialize(obj, mock, safe_mode)initialize40,1310
|
175
|
-
def flexmock_getflexmock_get55,1675
|
176
|
-
def should_receive(*args)should_receive79,2615
|
177
|
-
def add_mock_method(obj, method_name)add_mock_method90,2893
|
178
|
-
def new_instances(*allocators, &block)new_instances118,3947
|
179
|
-
def invoke_original(method, args)invoke_original139,4749
|
180
|
-
def flexmock_verifyflexmock_verify147,5043
|
181
|
-
def flexmock_teardownflexmock_teardown152,5179
|
182
|
-
def flexmock_containerflexmock_container164,5517
|
183
|
-
def flexmock_container=(container)flexmock_container=170,5712
|
184
|
-
def flexmock_expectations_for(method_name)flexmock_expectations_for174,5828
|
185
|
-
def sclasssclass181,5989
|
186
|
-
def singleton?(method_name)singleton?187,6130
|
187
|
-
def hide_existing_method(method_name)hide_existing_method197,6592
|
188
|
-
def stow_existing_definition(method_name)stow_existing_definition204,6809
|
189
|
-
def create_alias_for_existing_method(method_name)create_alias_for_existing_method224,7526
|
190
|
-
def define_proxy_method(method_name)define_proxy_method242,8045
|
191
|
-
def restore_original_definition(method_name)restore_original_definition263,8745
|
192
|
-
def remove_current_method(method_name)remove_current_method275,9109
|
193
|
-
def detached?detached?280,9270
|
194
|
-
def new_name(old_name)new_name285,9378
|
195
|
-
|
196
|
-
lib/flexmock/rails/view_mocking.rb,404
|
197
|
-
class FlexMockFlexMock3,20
|
198
|
-
module MockContainerMockContainer4,35
|
199
|
-
def rails_versionrails_version6,59
|
200
|
-
def should_render_view(template_name=nil)should_render_view25,684
|
201
|
-
def should_render_view_prior_version_124(template_name) # :nodoc:should_render_view_prior_version_12437,1045
|
202
|
-
def should_render_view_after_version_124(template_name)should_render_view_after_version_12457,1795
|
203
|
-
|
204
|
-
lib/flexmock/rails.rb,0
|
205
|
-
|
206
|
-
lib/flexmock/recorder.rb,271
|
207
|
-
class FlexMockFlexMock14,347
|
208
|
-
class RecorderRecorder20,523
|
209
|
-
def initialize(mock)initialize24,629
|
210
|
-
def should_be_strict(is_strict=true)should_be_strict48,1561
|
211
|
-
def strict?strict?53,1675
|
212
|
-
def method_missing(sym, *args, &block)method_missing59,1805
|
213
|
-
|
214
|
-
lib/flexmock/rspec.rb,341
|
215
|
-
class FlexMockFlexMock14,337
|
216
|
-
class RSpecFrameworkAdapterRSpecFrameworkAdapter16,355
|
217
|
-
def assert_block(msg, &block)assert_block17,385
|
218
|
-
def assert_equal(a, b, msg=nil)assert_equal21,481
|
219
|
-
class AssertionFailedError < StandardError; endAssertionFailedError26,644
|
220
|
-
def assertion_failed_errorassertion_failed_error27,696
|
221
|
-
|
222
|
-
lib/flexmock/test_unit.rb,120
|
223
|
-
module TestTest14,354
|
224
|
-
module UnitUnit15,366
|
225
|
-
class TestCaseTestCase16,380
|
226
|
-
def teardownteardown25,695
|
227
|
-
|
228
|
-
lib/flexmock/test_unit_integration.rb,227
|
229
|
-
class FlexMockFlexMock15,357
|
230
|
-
module TestCaseTestCase29,917
|
231
|
-
def teardownteardown35,1092
|
232
|
-
class TestUnitFrameworkAdapterTestUnitFrameworkAdapter45,1301
|
233
|
-
def assertion_failed_errorassertion_failed_error47,1369
|
234
|
-
|
235
|
-
lib/flexmock/undefined.rb,288
|
236
|
-
class FlexMockFlexMock12,312
|
237
|
-
class UndefinedUndefined17,483
|
238
|
-
def method_missing(sym, *args, &block)method_missing18,501
|
239
|
-
def to_sto_s22,564
|
240
|
-
def inspectinspect26,606
|
241
|
-
def cloneclone30,642
|
242
|
-
def coerce(other)coerce34,680
|
243
|
-
def self.undefinedundefined43,885
|
244
|
-
|
245
|
-
lib/flexmock/validators.rb,545
|
246
|
-
class FlexMockFlexMock14,337
|
247
|
-
class CountValidatorCountValidator19,473
|
248
|
-
def initialize(expectation, limit)initialize20,496
|
249
|
-
def eligible?(n)eligible?28,752
|
250
|
-
class ExactCountValidator < CountValidatorExactCountValidator36,917
|
251
|
-
def validate(n)validate39,1041
|
252
|
-
class AtLeastCountValidator < CountValidatorAtLeastCountValidator48,1332
|
253
|
-
def validate(n)validate51,1458
|
254
|
-
def eligible?(n)eligible?61,1875
|
255
|
-
class AtMostCountValidator < CountValidatorAtMostCountValidator69,2058
|
256
|
-
def validate(n)validate71,2173
|
257
|
-
|
258
|
-
lib/flexmock.rb,0
|
259
|
-
|
260
|
-
test/asserts.rb,139
|
261
|
-
class FlexMockFlexMock12,312
|
262
|
-
module FailureAssertionFailureAssertion15,368
|
263
|
-
def assert_failure(message=nil)assert_failure21,567
|
264
|
-
|
265
|
-
test/redirect_error.rb,114
|
266
|
-
class FlexMockFlexMock3,20
|
267
|
-
module RedirectErrorRedirectError4,35
|
268
|
-
def redirect_errorredirect_error5,58
|
269
|
-
|
270
|
-
test/rspec_integration/integration_spec.rb,0
|
271
|
-
|
272
|
-
test/test_aliasing.rb,522
|
273
|
-
class FlexMockFlexMock6,61
|
274
|
-
module StubsAndExpectsStubsAndExpects7,76
|
275
|
-
def expects(*args)expects8,101
|
276
|
-
def stubs(*args)stubs13,247
|
277
|
-
module MockContainerMockContainer18,311
|
278
|
-
class PartialMockProxyPartialMockProxy25,420
|
279
|
-
class AliasingTest < Test::Unit::TestCaseAliasingTest31,523
|
280
|
-
def test_mockingtest_mocking34,595
|
281
|
-
def test_once_mockingtest_once_mocking40,756
|
282
|
-
def test_twice_mockingtest_twice_mocking44,854
|
283
|
-
def test_stubbingtest_stubbing49,1033
|
284
|
-
def test_partialtest_partial54,1158
|
285
|
-
|
286
|
-
test/test_container_methods.rb,1111
|
287
|
-
class TestFlexmockContainerMethods < Test::Unit::TestCaseTestFlexmockContainerMethods16,410
|
288
|
-
def test_simple_mock_creationtest_simple_mock_creation19,498
|
289
|
-
def test_mock_with_nametest_mock_with_name25,639
|
290
|
-
def test_mock_with_symbol_nametest_mock_with_symbol_name32,848
|
291
|
-
def test_mock_with_hashtest_mock_with_hash39,1063
|
292
|
-
def test_mock_with_name_and_hashtest_mock_with_name_and_hash45,1208
|
293
|
-
def test_mock_with_name_hash_and_blocktest_mock_with_name_hash_and_block54,1516
|
294
|
-
def test_basic_stubtest_basic_stub62,1739
|
295
|
-
def test_basic_stub_with_nametest_basic_stub_with_name69,1901
|
296
|
-
def test_stub_with_quick_definitionstest_stub_with_quick_definitions77,2161
|
297
|
-
def test_stub_with_name_quick_definitionstest_stub_with_name_quick_definitions83,2305
|
298
|
-
def test_stubs_are_auto_verifiedtest_stubs_are_auto_verified92,2629
|
299
|
-
def test_stubbing_a_stringtest_stubbing_a_string99,2831
|
300
|
-
def test_multiple_stubs_work_with_same_partial_mock_proxytest_multiple_stubs_work_with_same_partial_mock_proxy105,2958
|
301
|
-
def test_multiple_stubs_layer_behaviortest_multiple_stubs_layer_behavior112,3130
|
302
|
-
|
303
|
-
test/test_default_framework_adapter.rb,475
|
304
|
-
class TestFlexmockDefaultFrameworkAdapter < Test::Unit::TestCaseTestFlexmockDefaultFrameworkAdapter15,352
|
305
|
-
def setupsetup16,417
|
306
|
-
def test_assert_block_raises_exception test_assert_block_raises_exception20,489
|
307
|
-
def test_assert_block_doesnt_raise_exceptiontest_assert_block_doesnt_raise_exception26,684
|
308
|
-
def test_assert_equal_doesnt_raise_exceptiontest_assert_equal_doesnt_raise_exception30,794
|
309
|
-
def test_assert_equal_can_failtest_assert_equal_can_fail34,900
|
310
|
-
|
311
|
-
test/test_demeter_mocking.rb,1569
|
312
|
-
class TestDemeterMocking < Test::Unit::TestCaseTestDemeterMocking7,84
|
313
|
-
def test_demeter_mockingtest_demeter_mocking11,199
|
314
|
-
def test_demeter_mocking_with_operatorstest_demeter_mocking_with_operators19,426
|
315
|
-
def test_demeter_mocking_with_multiple_operatorstest_demeter_mocking_with_multiple_operators28,715
|
316
|
-
def test_multiple_demeter_mocks_on_same_branch_is_oktest_multiple_demeter_mocks_on_same_branch_is_ok34,876
|
317
|
-
def test_multi_level_deep_demeter_violationtest_multi_level_deep_demeter_violation42,1168
|
318
|
-
def test_final_method_can_have_multiple_expecationstest_final_method_can_have_multiple_expecations48,1353
|
319
|
-
def test_conflicting_mock_declarations_raises_an_errortest_conflicting_mock_declarations_raises_an_error56,1644
|
320
|
-
def test_conflicting_mock_declarations_in_reverse_order_does_not_raise_errortest_conflicting_mock_declarations_in_reverse_order_does_not_raise_error68,2049
|
321
|
-
def test_preestablishing_existing_mock_is_oktest_preestablishing_existing_mock_is_ok78,2393
|
322
|
-
def test_quick_defs_can_use_demeter_mockingtest_quick_defs_can_use_demeter_mocking86,2656
|
323
|
-
def test_quick_defs_can_use_demeter_mocking_twotest_quick_defs_can_use_demeter_mocking_two96,2965
|
324
|
-
def test_errors_on_ill_formed_method_namestest_errors_on_ill_formed_method_names103,3194
|
325
|
-
def test_no_errors_on_well_formed_method_namestest_no_errors_on_well_formed_method_names112,3448
|
326
|
-
def test_readme_example_1test_readme_example_1121,3666
|
327
|
-
def test_readme_example_2test_readme_example_2131,4040
|
328
|
-
def test_readme_example_3test_readme_example_3137,4241
|
329
|
-
|
330
|
-
test/test_deprecated_methods.rb,2237
|
331
|
-
class TestFlexMock < Test::Unit::TestCaseTestFlexMock17,420
|
332
|
-
def s(&block)s21,526
|
333
|
-
def setupsetup25,576
|
334
|
-
def test_handletest_handle29,624
|
335
|
-
def test_handle_no_blocktest_handle_no_block36,768
|
336
|
-
def test_called_with_blocktest_called_with_block42,898
|
337
|
-
def test_return_valuetest_return_value49,1096
|
338
|
-
def test_handle_missing_methodtest_handle_missing_method54,1201
|
339
|
-
def test_ignore_missing_methodtest_ignore_missing_method62,1431
|
340
|
-
def test_good_countstest_good_counts68,1562
|
341
|
-
def test_bad_countstest_bad_counts76,1701
|
342
|
-
def test_undetermined_countstest_undetermined_counts87,1918
|
343
|
-
def test_zero_countstest_zero_counts96,2063
|
344
|
-
def test_file_io_with_usetest_file_io_with_use105,2242
|
345
|
-
def count_lines(stream)count_lines113,2446
|
346
|
-
def test_usetest_use121,2564
|
347
|
-
def test_failures_during_usetest_failures_during_use130,2721
|
348
|
-
def test_sequential_valuestest_sequential_values140,2940
|
349
|
-
def test_respond_to_returns_false_for_non_handled_methodstest_respond_to_returns_false_for_non_handled_methods149,3174
|
350
|
-
def test_respond_to_returns_true_for_explicit_methodstest_respond_to_returns_true_for_explicit_methods153,3309
|
351
|
-
def test_respond_to_returns_true_for_missing_methods_when_ignoring_missingtest_respond_to_returns_true_for_missing_methods_when_ignoring_missing158,3468
|
352
|
-
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
|
353
|
-
def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown168,3845
|
354
|
-
def test_method_returns_callable_proctest_method_returns_callable_proc174,3963
|
355
|
-
def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods183,4219
|
356
|
-
class TestDeprecatedOrderingMethods < Test::Unit::TestCaseTestDeprecatedOrderingMethods191,4446
|
357
|
-
def test_deprecated_ordering_methodstest_deprecated_ordering_methods195,4569
|
358
|
-
class TestAnyInstance < Test::Unit::TestCaseTestAnyInstance207,4965
|
359
|
-
class DogDog211,5074
|
360
|
-
def barkbark212,5086
|
361
|
-
def test_any_instance_still_works_for_backwards_compatibilitytest_any_instance_still_works_for_backwards_compatibility217,5126
|
362
|
-
|
363
|
-
test/test_examples_from_readme.rb,1207
|
364
|
-
class TemperatureSamplerTemperatureSampler15,352
|
365
|
-
def initialize(sensor)initialize16,377
|
366
|
-
def average_tempaverage_temp20,430
|
367
|
-
class TestTemperatureSampler < Test::Unit::TestCaseTestTemperatureSampler26,557
|
368
|
-
def test_tempurature_samplertest_tempurature_sampler29,639
|
369
|
-
class TestExamplesFromReadme < Test::Unit::TestCaseTestExamplesFromReadme38,918
|
370
|
-
def test_simple_return_valuestest_simple_return_values41,1000
|
371
|
-
def test_returning_an_undefined_valuetest_returning_an_undefined_value47,1140
|
372
|
-
def test_dbtest_db53,1280
|
373
|
-
def test_query_and_updatetest_query_and_update62,1510
|
374
|
-
def test_ordered_queriestest_ordered_queries71,1763
|
375
|
-
def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode89,2362
|
376
|
-
def test_build_xmltest_build_xml106,2894
|
377
|
-
def known_good_way_to_build_xml(rec)known_good_way_to_build_xml115,3149
|
378
|
-
def new_way_to_build_xml(rec)new_way_to_build_xml120,3219
|
379
|
-
def test_multiple_getstest_multiple_gets124,3307
|
380
|
-
def test_an_important_messagetest_an_important_message133,3552
|
381
|
-
class QuoteServiceQuoteService142,3782
|
382
|
-
class PortfolioPortfolio144,3809
|
383
|
-
def valuevalue145,3827
|
384
|
-
def test_portfolio_valuetest_portfolio_value150,3887
|
385
|
-
|
386
|
-
test/test_extended_should_receive.rb,809
|
387
|
-
module ExtendedShouldReceiveTestsExtendedShouldReceiveTests15,352
|
388
|
-
def test_accepts_expectation_hashtest_accepts_expectation_hash16,386
|
389
|
-
def test_accepts_list_of_methodstest_accepts_list_of_methods22,552
|
390
|
-
def test_contraints_apply_to_all_expectationstest_contraints_apply_to_all_expectations29,712
|
391
|
-
def test_count_contraints_apply_to_all_expectationstest_count_contraints_apply_to_all_expectations36,1001
|
392
|
-
def test_multiple_should_receives_are_allowedtest_multiple_should_receives_are_allowed42,1204
|
393
|
-
class TestExtendedShouldReceiveOnFullMocks < Test::Unit::TestCaseTestExtendedShouldReceiveOnFullMocks50,1421
|
394
|
-
def setupsetup54,1556
|
395
|
-
class TestExtendedShouldReceiveOnPartialMockProxies < Test::Unit::TestCaseTestExtendedShouldReceiveOnPartialMockProxies61,1626
|
396
|
-
def setupsetup65,1770
|
397
|
-
|
398
|
-
test/test_flexmodel.rb,528
|
399
|
-
class DummyModelDummyModel6,61
|
400
|
-
class ChildModel < DummyModelChildModel9,83
|
401
|
-
class TestFlexModel < Test::Unit::TestCaseTestFlexModel13,189
|
402
|
-
def test_initial_conditionstest_initial_conditions16,262
|
403
|
-
def test_classifying_mock_modelstest_classifying_mock_models28,663
|
404
|
-
def test_mock_models_have_different_idstest_mock_models_have_different_ids38,910
|
405
|
-
def test_mock_models_can_have_quick_defstest_mock_models_can_have_quick_defs44,1061
|
406
|
-
def test_mock_models_can_have_blockstest_mock_models_can_have_blocks49,1201
|
407
|
-
|
408
|
-
test/test_naming.rb,816
|
409
|
-
class TestNaming < Test::Unit::TestCaseTestNaming15,352
|
410
|
-
def test_nametest_name18,424
|
411
|
-
def test_name_in_no_handler_found_errortest_name_in_no_handler_found_error23,507
|
412
|
-
def test_name_in_received_count_errortest_name_in_received_count_error32,733
|
413
|
-
def test_naming_with_usetest_naming_with_use41,963
|
414
|
-
def test_naming_with_multiple_mocks_in_usetest_naming_with_multiple_mocks_in_use47,1080
|
415
|
-
def test_inspect_returns_reasonable_nametest_inspect_returns_reasonable_name54,1268
|
416
|
-
def test_mock_can_override_inspecttest_mock_can_override_inspect61,1452
|
417
|
-
class DummyDummy68,1655
|
418
|
-
def inspectinspect69,1669
|
419
|
-
def test_partial_mocks_use_original_inspecttest_partial_mocks_use_original_inspect74,1722
|
420
|
-
def test_partial_mocks_can_override_inspecttest_partial_mocks_can_override_inspect80,1886
|
421
|
-
|
422
|
-
test/test_new_instances.rb,2271
|
423
|
-
class TestNewInstances < Test::Unit::TestCaseTestNewInstances16,382
|
424
|
-
class DogDog20,494
|
425
|
-
def barkbark21,506
|
426
|
-
def wagwag24,539
|
427
|
-
def self.makemake27,571
|
428
|
-
class CatCat32,614
|
429
|
-
def initialize(name, &block)initialize34,648
|
430
|
-
class ConnectionConnection40,756
|
431
|
-
def initialize(*args)initialize41,775
|
432
|
-
def send(args)send44,843
|
433
|
-
def post(args)post47,887
|
434
|
-
def test_new_instances_allows_stubbing_of_existing_methodstest_new_instances_allows_stubbing_of_existing_methods52,938
|
435
|
-
def test_new_instances_stubs_still_have_existing_methodstest_new_instances_stubs_still_have_existing_methods60,1161
|
436
|
-
def test_new_instances_will_pass_args_to_newtest_new_instances_will_pass_args_to_new68,1376
|
437
|
-
def test_new_gets_block_after_restubbingtest_new_gets_block_after_restubbing81,1782
|
438
|
-
def test_new_instances_stub_verification_happens_on_teardowntest_new_instances_stub_verification_happens_on_teardown94,2107
|
439
|
-
def test_new_instances_reports_error_on_non_classestest_new_instances_reports_error_on_non_classes104,2470
|
440
|
-
def test_does_not_by_default_stub_objects_created_with_allocatetest_does_not_by_default_stub_objects_created_with_allocate114,2752
|
441
|
-
def test_can_explicitly_stub_objects_created_with_allocatetest_can_explicitly_stub_objects_created_with_allocate122,2982
|
442
|
-
def test_can_stub_objects_created_with_arbitrary_class_methodstest_can_stub_objects_created_with_arbitrary_class_methods130,3221
|
443
|
-
def test_stubbing_arbitrary_class_methods_leaves_new_alonetest_stubbing_arbitrary_class_methods_leaves_new_alone137,3446
|
444
|
-
def test_stubbing_new_and_allocate_doesnt_double_stub_objects_on_newtest_stubbing_new_and_allocate_doesnt_double_stub_objects_on_new144,3661
|
445
|
-
def test_blocks_on_new_do_not_have_stubs_installedtest_blocks_on_new_do_not_have_stubs_installed157,4116
|
446
|
-
def test_new_instances_accept_chained_expectationstest_new_instances_accept_chained_expectations171,4456
|
447
|
-
def test_fancy_use_of_chained_should_receivedtest_fancy_use_of_chained_should_received179,4728
|
448
|
-
def test_writable_accessorstest_writable_accessors184,4885
|
449
|
-
def test_ordering_can_be_specifiedtest_ordering_can_be_specified190,5032
|
450
|
-
def test_ordering_can_be_specified_in_groupstest_ordering_can_be_specified_in_groups198,5228
|
451
|
-
|
452
|
-
test/test_partial_mock.rb,4817
|
453
|
-
class TestStubbing < Test::Unit::TestCaseTestStubbing16,372
|
454
|
-
class DogDog19,446
|
455
|
-
def barkbark20,458
|
456
|
-
def Dog.createcreate23,491
|
457
|
-
class DogPlus < DogDogPlus28,540
|
458
|
-
def should_receiveshould_receive29,562
|
459
|
-
def new_instancesnew_instances32,611
|
460
|
-
def by_defaultby_default35,656
|
461
|
-
def test_stub_command_add_behavior_to_arbitrary_objectstest_stub_command_add_behavior_to_arbitrary_objects40,712
|
462
|
-
def test_stub_command_can_configure_via_blocktest_stub_command_can_configure_via_block46,898
|
463
|
-
def test_stubbed_methods_can_take_blockstest_stubbed_methods_can_take_blocks54,1097
|
464
|
-
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
|
465
|
-
def test_multiple_methods_can_be_stubbedtest_multiple_methods_can_be_stubbed66,1473
|
466
|
-
def test_original_behavior_can_be_restoredtest_original_behavior_can_be_restored74,1727
|
467
|
-
def test_original_missing_behavior_can_be_restoredtest_original_missing_behavior_can_be_restored84,2064
|
468
|
-
def test_multiple_stubs_on_single_method_can_be_restored_missing_methodtest_multiple_stubs_on_single_method_can_be_restored_missing_method93,2343
|
469
|
-
def test_original_behavior_is_restored_when_multiple_methods_are_mockedtest_original_behavior_is_restored_when_multiple_methods_are_mocked104,2754
|
470
|
-
def test_original_behavior_is_restored_on_class_objectstest_original_behavior_is_restored_on_class_objects113,3083
|
471
|
-
def test_original_behavior_is_restored_on_singleton_methodstest_original_behavior_is_restored_on_singleton_methods120,3334
|
472
|
-
def obj.hi() :hello endhi122,3417
|
473
|
-
def test_original_behavior_is_restored_on_singleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_singleton_methods_with_multiple_stubs130,3613
|
474
|
-
def obj.hi(n) "hello#{n}" endhi132,3716
|
475
|
-
def test_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubstest_original_behavior_is_restored_on_nonsingleton_methods_with_multiple_stubs142,4037
|
476
|
-
def test_stubbing_file_shouldnt_break_writingtest_stubbing_file_shouldnt_break_writing158,4531
|
477
|
-
def test_original_behavior_is_restored_even_when_errorstest_original_behavior_is_restored_even_when_errors174,4970
|
478
|
-
def m.flexmock_verify() endflexmock_verify182,5289
|
479
|
-
def test_not_calling_stubbed_method_is_an_errortest_not_calling_stubbed_method_is_an_error185,5328
|
480
|
-
def test_mock_is_verified_when_the_stub_is_verifiedtest_mock_is_verified_when_the_stub_is_verified194,5557
|
481
|
-
def test_stub_can_have_explicit_nametest_stub_can_have_explicit_name203,5827
|
482
|
-
def test_unamed_stub_will_use_default_naming_conventiontest_unamed_stub_will_use_default_naming_convention209,6006
|
483
|
-
def test_partials_can_be_defined_in_a_blocktest_partials_can_be_defined_in_a_block215,6202
|
484
|
-
def test_partials_defining_block_return_real_obj_not_proxytest_partials_defining_block_return_real_obj_not_proxy223,6389
|
485
|
-
def test_partial_mocks_always_return_domain_objecttest_partial_mocks_always_return_domain_object230,6583
|
486
|
-
def test_domain_objects_do_not_have_mock_methodstest_domain_objects_do_not_have_mock_methods241,6863
|
487
|
-
def test_partial_mocks_have_mock_methodstest_partial_mocks_have_mock_methods248,7055
|
488
|
-
def test_partial_mocks_do_not_have_mock_methods_after_teardowntest_partial_mocks_do_not_have_mock_methods_after_teardown256,7251
|
489
|
-
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
|
490
|
-
def dog.mock() :original endmock267,7608
|
491
|
-
class MockColisionMockColision273,7729
|
492
|
-
def mockmock274,7750
|
493
|
-
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
|
494
|
-
def test_safe_partial_mocks_do_not_support_mock_methodstest_safe_partial_mocks_do_not_support_mock_methods286,7998
|
495
|
-
def test_safe_partial_mocks_require_blocktest_safe_partial_mocks_require_block294,8226
|
496
|
-
def test_safe_partial_mocks_are_actually_mockedtest_safe_partial_mocks_are_actually_mocked299,8364
|
497
|
-
def test_should_receive_does_not_override_preexisting_deftest_should_receive_does_not_override_preexisting_def304,8534
|
498
|
-
class LiarLiar311,8787
|
499
|
-
def respond_to?(method_name)respond_to?312,8800
|
500
|
-
def test_liar_actually_liestest_liar_actually_lies322,8969
|
501
|
-
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_there328,9121
|
502
|
-
class ValueObjectValueObject339,9550
|
503
|
-
def initialize(val)initialize342,9592
|
504
|
-
def ==(other)==346,9642
|
505
|
-
def test_partial_mocks_in_the_presense_of_equal_definitiontest_partial_mocks_in_the_presense_of_equal_definition351,9699
|
506
|
-
|
507
|
-
test/test_rails_view_stub.rb,931
|
508
|
-
module ViewTestsViewTests6,80
|
509
|
-
def test_view_mocks_as_stubtest_view_mocks_as_stub7,97
|
510
|
-
def test_fails_if_no_rendertest_fails_if_no_render12,191
|
511
|
-
def test_view_mocks_with_expectationtest_view_mocks_with_expectation19,335
|
512
|
-
def test_view_mocks_with_expectation_fails_with_different_templatetest_view_mocks_with_expectation_fails_with_different_template24,439
|
513
|
-
def test_view_mocks_with_expectation_wand_multiple_templatestest_view_mocks_with_expectation_wand_multiple_templates32,658
|
514
|
-
def pretend_to_be_rails_version(version)pretend_to_be_rails_version39,835
|
515
|
-
class TestRailsViewStubForVersionsUpTo_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsUpTo_1_2_445,1030
|
516
|
-
def setupsetup49,1148
|
517
|
-
def render(*names)render56,1377
|
518
|
-
class TestRailsViewStubForVersionsAfter_1_2_4 < Test::Unit::TestCaseTestRailsViewStubForVersionsAfter_1_2_470,1655
|
519
|
-
def setupsetup74,1774
|
520
|
-
def render(*names)render82,2047
|
521
|
-
|
522
|
-
test/test_record_mode.rb,1339
|
523
|
-
class TestRecordMode < Test::Unit::TestCaseTestRecordMode16,390
|
524
|
-
def test_recording_mode_workstest_recording_mode_works20,505
|
525
|
-
def test_arguments_are_passed_to_recording_mode_blocktest_arguments_are_passed_to_recording_mode_block28,687
|
526
|
-
def test_recording_mode_handles_multiple_returnstest_recording_mode_handles_multiple_returns39,962
|
527
|
-
def test_recording_mode_does_not_specify_ordertest_recording_mode_does_not_specify_order53,1386
|
528
|
-
def test_recording_mode_gets_block_args_tootest_recording_mode_gets_block_args_too64,1632
|
529
|
-
def test_recording_mode_should_validate_args_with_equalstest_recording_mode_should_validate_args_with_equals76,1914
|
530
|
-
def test_recording_mode_should_allow_arg_contraint_validationtest_recording_mode_should_allow_arg_contraint_validation87,2149
|
531
|
-
def test_recording_mode_should_handle_multiplicity_contraintstest_recording_mode_should_handle_multiplicity_contraints98,2390
|
532
|
-
def test_strict_record_mode_requires_exact_argument_matchestest_strict_record_mode_requires_exact_argument_matches110,2657
|
533
|
-
def test_strict_record_mode_requires_exact_orderingtest_strict_record_mode_requires_exact_ordering122,2937
|
534
|
-
def test_strict_record_mode_requires_oncetest_strict_record_mode_requires_once136,3242
|
535
|
-
def test_strict_record_mode_can_not_failtest_strict_record_mode_can_not_fail149,3517
|
536
|
-
|
537
|
-
test/test_samples.rb,2164
|
538
|
-
class TestSamples < Test::Unit::TestCaseTestSamples17,378
|
539
|
-
def test_file_iotest_file_io25,748
|
540
|
-
def count_lines(file)count_lines33,999
|
541
|
-
class TestUndefined < Test::Unit::TestCaseTestUndefined43,1092
|
542
|
-
def test_undefined_valuestest_undefined_values46,1165
|
543
|
-
class TestSimple < Test::Unit::TestCaseTestSimple55,1351
|
544
|
-
def test_simple_mocktest_simple_mock58,1421
|
545
|
-
class TestDog < Test::Unit::TestCaseTestDog65,1556
|
546
|
-
def test_dog_wagstest_dog_wags68,1625
|
547
|
-
class WooferWoofer74,1736
|
548
|
-
class DogDog77,1754
|
549
|
-
def initializeinitialize78,1764
|
550
|
-
def barkbark81,1812
|
551
|
-
def wagwag84,1846
|
552
|
-
class TestDogBarking < Test::Unit::TestCaseTestDogBarking89,1878
|
553
|
-
def setupsetup94,2043
|
554
|
-
def test_dogtest_dog99,2118
|
555
|
-
class TestDogBarkingWithNewInstances < Test::Unit::TestCaseTestDogBarkingWithNewInstances105,2249
|
556
|
-
def setupsetup110,2415
|
557
|
-
def test_dogtest_dog114,2502
|
558
|
-
class TestDefaults < Test::Unit::TestCaseTestDefaults120,2636
|
559
|
-
def setupsetup123,2708
|
560
|
-
def test_something_where_bark_must_be_called_oncetest_something_where_bark_must_be_called_once128,2837
|
561
|
-
class TestDemeter < Test::Unit::TestCaseTestDemeter136,3040
|
562
|
-
def test_manual_mockingtest_manual_mocking138,3110
|
563
|
-
def test_demetertest_demeter151,3544
|
564
|
-
class TestDb < Test::Unit::TestCaseTestDb161,3759
|
565
|
-
def test_dbtest_db164,3825
|
566
|
-
class TestDb < Test::Unit::TestCaseTestDb175,4030
|
567
|
-
def test_query_and_updatetest_query_and_update178,4096
|
568
|
-
def test_ordered_queriestest_ordered_queries189,4383
|
569
|
-
def test_ordered_queries_in_record_modetest_ordered_queries_in_record_mode207,4923
|
570
|
-
def known_good_way_to_build_xml(builder)known_good_way_to_build_xml224,5400
|
571
|
-
def new_way_to_build_xml(builder)new_way_to_build_xml228,5467
|
572
|
-
def test_build_xmltest_build_xml232,5551
|
573
|
-
class TestMoreSamples < Test::Unit::TestCaseTestMoreSamples243,5813
|
574
|
-
def test_multiple_getstest_multiple_gets246,5888
|
575
|
-
def test_an_important_messagetest_an_important_message255,6133
|
576
|
-
class QuoteServiceQuoteService264,6394
|
577
|
-
class PortfolioPortfolio267,6422
|
578
|
-
def initializeinitialize268,6440
|
579
|
-
def valuevalue271,6507
|
580
|
-
def test_portfolio_valuetest_portfolio_value276,6563
|
581
|
-
|
582
|
-
test/test_should_ignore_missing.rb,1173
|
583
|
-
class TestShouldIgnoreMissing < Test::Unit::TestCaseTestShouldIgnoreMissing16,375
|
584
|
-
def setupsetup19,458
|
585
|
-
def test_mocks_do_not_respond_to_undefined_methodstest_mocks_do_not_respond_to_undefined_methods23,508
|
586
|
-
def test_mocks_do_respond_to_defined_methodstest_mocks_do_respond_to_defined_methods27,612
|
587
|
-
def test_mocks_do_respond_to_any_method_when_ignoring_missingtest_mocks_do_respond_to_any_method_when_ignoring_missing32,752
|
588
|
-
def test_ignored_methods_return_undefinedtest_ignored_methods_return_undefined37,898
|
589
|
-
def test_undefined_mocking_with_argumentstest_undefined_mocking_with_arguments43,1072
|
590
|
-
def test_method_chains_with_undefined_are_self_preservingtest_method_chains_with_undefined_are_self_preserving48,1220
|
591
|
-
def test_method_proc_raises_error_on_unknowntest_method_proc_raises_error_on_unknown53,1385
|
592
|
-
def test_method_returns_callable_proctest_method_returns_callable_proc59,1509
|
593
|
-
def test_not_calling_method_proc_will_fail_count_constraintstest_not_calling_method_proc_will_fail_count_constraints66,1693
|
594
|
-
def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods75,1965
|
595
|
-
|
596
|
-
test/test_should_receive.rb,10493
|
597
|
-
def mock_top_level_functionmock_top_level_function16,375
|
598
|
-
module KernelKernel20,416
|
599
|
-
def mock_kernel_functionmock_kernel_function21,430
|
600
|
-
class TestFlexMockShoulds < Test::Unit::TestCaseTestFlexMockShoulds26,477
|
601
|
-
def test_defaultstest_defaults38,1021
|
602
|
-
def test_returns_with_valuetest_returns_with_value47,1189
|
603
|
-
def test_returns_with_multiple_valuestest_returns_with_multiple_values55,1358
|
604
|
-
def test_multiple_returnstest_multiple_returns66,1618
|
605
|
-
def test_returns_with_blocktest_returns_with_block77,1878
|
606
|
-
def test_block_example_from_readmetest_block_example_from_readme86,2081
|
607
|
-
def test_return_with_and_without_block_interleavedtest_return_with_and_without_block_interleaved96,2377
|
608
|
-
def test_and_returns_aliastest_and_returns_alias106,2657
|
609
|
-
def test_and_return_undefinedtest_and_return_undefined113,2794
|
610
|
-
def test_and_yield_will_continue_to_yield_the_same_valuetest_and_yield_will_continue_to_yield_the_same_value123,3143
|
611
|
-
def test_and_yield_with_multiple_values_yields_the_valuestest_and_yield_with_multiple_values_yields_the_values131,3389
|
612
|
-
def test_multiple_yields_are_done_sequentiallytest_multiple_yields_are_done_sequentially138,3599
|
613
|
-
def test_failure_if_no_block_giventest_failure_if_no_block_given147,3871
|
614
|
-
def test_failure_different_return_value_than_yield_returntest_failure_different_return_value_than_yield_return154,4054
|
615
|
-
def test_multiple_yieldstest_multiple_yields163,4340
|
616
|
-
def test_multiple_yields_will_yield_the_last_value_settest_multiple_yields_will_yield_the_last_value_set171,4578
|
617
|
-
def test_yielding_then_not_yielding_and_then_yielding_againtest_yielding_then_not_yielding_and_then_yielding_again182,4955
|
618
|
-
def test_yields_syntaxtest_yields_syntax193,5302
|
619
|
-
class MyError < RuntimeErrorMyError200,5447
|
620
|
-
def test_and_raises_with_exception_class_throws_exceptiontest_and_raises_with_exception_class_throws_exception203,5485
|
621
|
-
def test_and_raises_with_arguments_throws_exception_made_with_argstest_and_raises_with_arguments_throws_exception_made_with_args212,5694
|
622
|
-
def test_and_raises_with_a_specific_exception_throws_the_exceptiontest_and_raises_with_a_specific_exception_throws_the_exception222,5975
|
623
|
-
def test_raises_is_an_alias_for_and_raisetest_raises_is_an_alias_for_and_raise233,6245
|
624
|
-
def test_multiple_and_raise_clauses_will_be_done_sequentiallytest_multiple_and_raise_clauses_will_be_done_sequentially242,6450
|
625
|
-
def test_and_throw_will_throw_a_symboltest_and_throw_will_throw_a_symbol254,6848
|
626
|
-
def test_and_throw_with_expression_will_throwtest_and_throw_with_expression_will_throw265,7091
|
627
|
-
def test_throws_is_an_alias_for_and_throwtest_throws_is_an_alias_for_and_throw276,7373
|
628
|
-
def test_multiple_throws_will_be_done_sequentiallytest_multiple_throws_will_be_done_sequentially287,7648
|
629
|
-
def test_multiple_expectationstest_multiple_expectations299,7978
|
630
|
-
def test_with_no_args_with_no_argstest_with_no_args_with_no_args309,8215
|
631
|
-
def test_with_no_args_but_with_argstest_with_no_args_but_with_args316,8343
|
632
|
-
def test_with_any_argstest_with_any_args325,8542
|
633
|
-
def test_with_any_single_arg_matchingtest_with_any_single_arg_matching335,8720
|
634
|
-
def test_with_any_single_arg_nonmatchingtest_with_any_single_arg_nonmatching343,8913
|
635
|
-
def test_with_equal_arg_matchingtest_with_equal_arg_matching353,9148
|
636
|
-
def test_with_equal_arg_nonmatchingtest_with_equal_arg_nonmatching360,9311
|
637
|
-
def test_with_arbitrary_arg_matchingtest_with_arbitrary_arg_matching369,9548
|
638
|
-
def test_args_matching_with_regextest_args_matching_with_regex384,9968
|
639
|
-
def test_arg_matching_with_regex_matching_non_stringtest_arg_matching_with_regex_matching_non_string396,10295
|
640
|
-
def test_arg_matching_with_classtest_arg_matching_with_class403,10472
|
641
|
-
def test_arg_matching_with_no_matchtest_arg_matching_with_no_match414,10762
|
642
|
-
def test_arg_matching_with_string_doesnt_over_matchtest_arg_matching_with_string_doesnt_over_match423,10975
|
643
|
-
def test_block_arg_given_to_no_argstest_block_arg_given_to_no_args432,11194
|
644
|
-
def test_block_arg_given_to_matching_proctest_block_arg_given_to_matching_proc441,11398
|
645
|
-
def test_arg_matching_precedence_when_best_firsttest_arg_matching_precedence_when_best_first452,11683
|
646
|
-
def test_arg_matching_precedence_when_best_last_but_still_matches_firsttest_arg_matching_precedence_when_best_last_but_still_matches_first460,11892
|
647
|
-
def test_never_and_never_calledtest_never_and_never_called468,12124
|
648
|
-
def test_never_and_called_oncetest_never_and_called_once474,12239
|
649
|
-
def test_once_called_oncetest_once_called_once483,12435
|
650
|
-
def test_once_but_never_calledtest_once_but_never_called490,12569
|
651
|
-
def test_once_but_called_twicetest_once_but_called_twice498,12756
|
652
|
-
def test_twice_and_called_twicetest_twice_and_called_twice508,12975
|
653
|
-
def test_zero_or_more_called_zerotest_zero_or_more_called_zero516,13130
|
654
|
-
def test_zero_or_more_called_oncetest_zero_or_more_called_once522,13252
|
655
|
-
def test_zero_or_more_called_100test_zero_or_more_called_100529,13385
|
656
|
-
def test_timestest_times536,13531
|
657
|
-
def test_at_least_called_oncetest_at_least_called_once543,13672
|
658
|
-
def test_at_least_but_never_calledtest_at_least_but_never_called550,13819
|
659
|
-
def test_at_least_once_but_called_twicetest_at_least_once_but_called_twice558,14022
|
660
|
-
def test_at_least_and_exacttest_at_least_and_exact566,14193
|
661
|
-
def test_at_most_but_never_calledtest_at_most_but_never_called576,14423
|
662
|
-
def test_at_most_called_oncetest_at_most_called_once582,14559
|
663
|
-
def test_at_most_called_twicetest_at_most_called_twice589,14704
|
664
|
-
def test_at_most_and_at_least_called_nevertest_at_most_and_at_least_called_never599,14932
|
665
|
-
def test_at_most_and_at_least_called_oncetest_at_most_and_at_least_called_once607,15157
|
666
|
-
def test_at_most_and_at_least_called_twicetest_at_most_and_at_least_called_twice614,15330
|
667
|
-
def test_at_most_and_at_least_called_three_timestest_at_most_and_at_least_called_three_times622,15518
|
668
|
-
def test_call_counts_only_apply_to_matching_argstest_call_counts_only_apply_to_matching_args633,15796
|
669
|
-
def test_call_counts_only_apply_to_matching_args_with_mismatchtest_call_counts_only_apply_to_matching_args_with_mismatch645,16074
|
670
|
-
def test_ordered_calls_in_order_will_passtest_ordered_calls_in_order_will_pass661,16507
|
671
|
-
def test_ordered_calls_out_of_order_will_failtest_ordered_calls_out_of_order_will_fail671,16689
|
672
|
-
def test_order_calls_with_different_arg_lists_and_in_order_will_passtest_order_calls_with_different_arg_lists_and_in_order_will_pass683,16950
|
673
|
-
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_fail693,17203
|
674
|
-
def test_unordered_calls_do_not_effect_ordered_testingtest_unordered_calls_do_not_effect_ordered_testing705,17529
|
675
|
-
def test_ordered_with_multiple_calls_will_passtest_ordered_with_multiple_calls_will_pass719,17799
|
676
|
-
def test_grouped_ordering_with_numberstest_grouped_ordering_with_numbers731,18014
|
677
|
-
def test_grouped_ordering_with_symbolstest_grouped_ordering_with_symbols746,18335
|
678
|
-
def test_explicit_ordering_mixed_with_implicit_ordering_should_not_overlaptest_explicit_ordering_mixed_with_implicit_ordering_should_not_overlap761,18697
|
679
|
-
def test_explicit_ordering_with_explicit_misorderstest_explicit_ordering_with_explicit_misorders771,19070
|
680
|
-
def test_ordering_with_explicit_no_args_matches_correctlytest_ordering_with_explicit_no_args_matches_correctly787,19601
|
681
|
-
def test_ordering_with_any_arg_matching_correctly_matchestest_ordering_with_any_arg_matching_correctly_matches799,19978
|
682
|
-
def test_ordering_between_mocks_is_not_normally_definedtest_ordering_between_mocks_is_not_normally_defined810,20290
|
683
|
-
def test_ordering_between_mocks_is_honored_for_global_orderingtest_ordering_between_mocks_is_honored_for_global_ordering822,20546
|
684
|
-
def test_expectation_formatingtest_expectation_formating834,20864
|
685
|
-
def test_multi_expectation_formattingtest_multi_expectation_formatting843,21092
|
686
|
-
def test_explicit_ordering_with_limits_allow_multiple_return_valuestest_explicit_ordering_with_limits_allow_multiple_return_values849,21255
|
687
|
-
def test_global_methods_can_be_mockedtest_global_methods_can_be_mocked868,21966
|
688
|
-
def test_kernel_methods_can_be_mockedtest_kernel_methods_can_be_mocked874,22150
|
689
|
-
def test_undefing_kernel_methods_dont_effect_other_mockstest_undefing_kernel_methods_dont_effect_other_mocks880,22328
|
690
|
-
def test_expectations_can_by_marked_as_defaulttest_expectations_can_by_marked_as_default888,22596
|
691
|
-
def test_default_expectations_are_search_in_the_proper_ordertest_default_expectations_are_search_in_the_proper_order894,22762
|
692
|
-
def test_expectations_with_count_constraints_can_by_marked_as_defaulttest_expectations_with_count_constraints_can_by_marked_as_default902,23069
|
693
|
-
def test_default_expectations_are_overridden_by_later_expectationstest_default_expectations_are_overridden_by_later_expectations910,23315
|
694
|
-
def test_ordered_default_expectations_can_be_specifiedtest_ordered_default_expectations_can_be_specified918,23543
|
695
|
-
def test_ordered_default_expectations_can_be_overriddentest_ordered_default_expectations_can_be_overridden926,23794
|
696
|
-
def test_by_default_works_at_mock_leveltest_by_default_works_at_mock_level938,24065
|
697
|
-
def test_by_default_at_mock_level_does_nothing_with_no_expectationstest_by_default_at_mock_level_does_nothing_with_no_expectations949,24340
|
698
|
-
def test_partial_mocks_can_have_default_expectationstest_partial_mocks_can_have_default_expectations955,24485
|
699
|
-
def test_partial_mocks_can_have_default_expectations_overriddentest_partial_mocks_can_have_default_expectations_overridden961,24666
|
700
|
-
def test_wicked_and_evil_tricks_with_by_default_are_thwartedtest_wicked_and_evil_tricks_with_by_default_are_thwarted968,24914
|
701
|
-
def test_mocks_can_handle_multi_parameter_respond_tostest_mocks_can_handle_multi_parameter_respond_tos980,25319
|
702
|
-
def test_can_mock_operatorstest_can_mock_operators991,25666
|
703
|
-
def assert_operator(op, &block)assert_operator1020,26681
|
704
|
-
class TestFlexMockShouldsWithInclude < Test::Unit::TestCaseTestFlexMockShouldsWithInclude1028,26835
|
705
|
-
def test_include_enables_unqualified_arg_type_referencestest_include_enables_unqualified_arg_type_references1030,26929
|
706
|
-
class TestFlexMockArgTypesDontLeak < Test::Unit::TestCaseTestFlexMockArgTypesDontLeak1038,27093
|
707
|
-
def test_unqualified_arg_type_references_are_undefined_by_defaulttest_unqualified_arg_type_references_are_undefined_by_default1039,27151
|
708
|
-
|
709
|
-
test/test_tu_integration.rb,1570
|
710
|
-
class TestTuIntegrationFlexMockMethod < Test::Unit::TestCaseTestTuIntegrationFlexMockMethod15,352
|
711
|
-
def test_can_construct_flexmocktest_can_construct_flexmock18,445
|
712
|
-
def test_can_construct_flexmock_with_blocktest_can_construct_flexmock_with_block24,594
|
713
|
-
class TestTuIntegrationMockVerificationInTeardown < Test::Unit::TestCaseTestTuIntegrationMockVerificationInTeardown32,770
|
714
|
-
def teardownteardown35,873
|
715
|
-
def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown41,969
|
716
|
-
class TestTuIntegrationMockVerificationWithoutSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationWithoutSetup46,1087
|
717
|
-
def teardownteardown49,1192
|
718
|
-
def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown55,1288
|
719
|
-
class TestTuIntegrationMockVerificationForgetfulSetup < Test::Unit::TestCaseTestTuIntegrationMockVerificationForgetfulSetup60,1406
|
720
|
-
def teardownteardown63,1513
|
721
|
-
def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown69,1609
|
722
|
-
class TestTuIntegrationSetupOverridenAndNoMocksOk < Test::Unit::TestCaseTestTuIntegrationSetupOverridenAndNoMocksOk74,1727
|
723
|
-
def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown77,1830
|
724
|
-
class TestTuIntegrationFailurePreventsVerification < Test::Unit::TestCaseTestTuIntegrationFailurePreventsVerification81,1893
|
725
|
-
def test_mock_verification_occurs_during_teardowntest_mock_verification_occurs_during_teardown84,1997
|
726
|
-
def simulate_failuresimulate_failure91,2131
|
727
|
-
|
728
|
-
test/test_undefined.rb,873
|
729
|
-
class UndefinedTest < Test::Unit::TestCaseUndefinedTest15,352
|
730
|
-
def test_undefined_method_calls_return_undefinedtest_undefined_method_calls_return_undefined16,395
|
731
|
-
def test_equalstest_equals20,513
|
732
|
-
def test_math_operatorstest_math_operators25,611
|
733
|
-
def test_math_operators_reversedtest_math_operators_reversed33,820
|
734
|
-
def test_comparisonstest_comparisons41,1038
|
735
|
-
def test_comparisons_reversedtest_comparisons_reversed49,1247
|
736
|
-
def test_base_level_methodstest_base_level_methods57,1465
|
737
|
-
def test_cant_create_a_new_undefinedtest_cant_create_a_new_undefined61,1552
|
738
|
-
def test_cant_clone_undefinedtest_cant_clone_undefined65,1662
|
739
|
-
def test_string_representationstest_string_representations70,1796
|
740
|
-
def test_undefined_is_not_niltest_undefined_is_not_nil75,1934
|
741
|
-
def assert_undefined(obj)assert_undefined81,2012
|
742
|
-
def undefinedundefined85,2075
|
743
|
-
|
744
|
-
test/test_unit_integration/test_auto_test_unit.rb,263
|
745
|
-
class TestFlexmockTestUnit < Test::Unit::TestCaseTestFlexmockTestUnit17,387
|
746
|
-
def teardownteardown18,437
|
747
|
-
def test_can_create_mockstest_can_create_mocks23,496
|
748
|
-
def test_should_fail__mocks_are_auto_verifiedtest_should_fail__mocks_are_auto_verified30,641
|