flexmock 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README → README.rdoc} +4 -2
- data/Rakefile +12 -12
- data/TAGS +152 -176
- data/lib/flexmock/expectation_director.rb +2 -2
- data/lib/flexmock/mock_container.rb +8 -5
- data/test/test_should_receive.rb +1 -0
- metadata +23 -9
data/{README → README.rdoc}
RENAMED
@@ -3,13 +3,15 @@
|
|
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.7
|
7
7
|
|
8
8
|
= Links
|
9
9
|
|
10
10
|
<b>Documents</b> :: http://flexmock.rubyforge.org
|
11
11
|
<b>RubyGems</b> :: Install with: <b>gem install flexmock</b>
|
12
12
|
<b>Download</b> :: Download from RubyForge at http://rubyforge.org/frs/?group_id=3433 (pre 0.6.0 versions may be found at http://rubyforge.org/frs/?group_id=170)
|
13
|
+
<b>Issue Tracking</b> :: http://www.pivotaltracker.com/projects/28401
|
14
|
+
<b>Bug Reports</b> :: http://onestepback.org/cgi-bin/bugs.cgi?project=flexmock
|
13
15
|
|
14
16
|
== Installation
|
15
17
|
|
@@ -508,7 +510,7 @@ The following rules are used for argument matching:
|
|
508
510
|
* If you wish to specify a complex matching criteria, use the
|
509
511
|
<tt>FlexMock.on(&block)</tt> with the logic contained in the block.
|
510
512
|
|
511
|
-
Examples (assumes FlexMock::
|
513
|
+
Examples (assumes FlexMock::ArgumentTypes has been included):
|
512
514
|
|
513
515
|
with(on { |arg| (arg % 2) == 0 } )
|
514
516
|
|
data/Rakefile
CHANGED
@@ -19,18 +19,18 @@ require 'rake/contrib/rubyforgepublisher'
|
|
19
19
|
CLEAN.include('*.tmp')
|
20
20
|
CLOBBER.include("html", 'pkg')
|
21
21
|
|
22
|
-
PKG_VERSION = '0.8.
|
22
|
+
PKG_VERSION = '0.8.7'
|
23
23
|
|
24
24
|
PKG_FILES = FileList[
|
25
25
|
'[A-Z]*',
|
26
|
-
'lib/**/*.rb',
|
26
|
+
'lib/**/*.rb',
|
27
27
|
'test/**/*.rb',
|
28
28
|
'*.blurb',
|
29
29
|
'install.rb'
|
30
30
|
]
|
31
31
|
|
32
32
|
RDOC_FILES = FileList[
|
33
|
-
'README',
|
33
|
+
'README.rdoc',
|
34
34
|
'CHANGES',
|
35
35
|
'lib/**/*.rb',
|
36
36
|
'doc/**/*.rdoc',
|
@@ -68,7 +68,7 @@ end
|
|
68
68
|
|
69
69
|
begin
|
70
70
|
require 'rcov/rcovtask'
|
71
|
-
|
71
|
+
|
72
72
|
Rcov::RcovTask.new do |t|
|
73
73
|
t.libs << "test"
|
74
74
|
t.rcov_opts = ['-xRakefile', '-xrakefile', '-xpublish.rf', '-x/Lib*', '--text-report', '--sort', 'coverage']
|
@@ -80,7 +80,7 @@ end
|
|
80
80
|
|
81
81
|
# RDoc Target --------------------------------------------------------
|
82
82
|
|
83
|
-
task :rdoc => ["README"]
|
83
|
+
task :rdoc => ["README.rdoc"]
|
84
84
|
|
85
85
|
$rd = Rake::RDocTask.new("rdoc") do |rdoc|
|
86
86
|
rdoc.rdoc_dir = 'html'
|
@@ -89,12 +89,12 @@ $rd = Rake::RDocTask.new("rdoc") do |rdoc|
|
|
89
89
|
# rdoc.template = 'kilmer'
|
90
90
|
# rdoc.template = 'css2'
|
91
91
|
rdoc.title = "Flex Mock"
|
92
|
-
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
|
92
|
+
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
|
93
93
|
rdoc.rdoc_files.include(RDOC_FILES)
|
94
94
|
end
|
95
95
|
|
96
|
-
file "README" => ["Rakefile"] do
|
97
|
-
ruby %{-i.bak -pe 'sub!(/^Version *:: *(\\d+\\.)+\\d+ *$/, "Version :: #{PKG_VERSION}")' README} # "
|
96
|
+
file "README.rdoc" => ["Rakefile"] do
|
97
|
+
ruby %{-i.bak -pe 'sub!(/^Version *:: *(\\d+\\.)+\\d+ *$/, "Version :: #{PKG_VERSION}")' README.rdoc} # "
|
98
98
|
end
|
99
99
|
|
100
100
|
# Package Task -------------------------------------------------------
|
@@ -103,7 +103,7 @@ if ! defined?(Gem)
|
|
103
103
|
puts "Package Target requires RubyGEMs"
|
104
104
|
else
|
105
105
|
spec = Gem::Specification.new do |s|
|
106
|
-
|
106
|
+
|
107
107
|
#### Basic information.
|
108
108
|
|
109
109
|
s.name = 'flexmock'
|
@@ -111,15 +111,15 @@ else
|
|
111
111
|
s.summary = "Simple and Flexible Mock Objects for Testing"
|
112
112
|
s.description = %{
|
113
113
|
FlexMock is a extremely simple mock object class compatible
|
114
|
-
with the Test::Unit framework. Although the FlexMock's
|
114
|
+
with the Test::Unit framework. Although the FlexMock's
|
115
115
|
interface is simple, it is very flexible.
|
116
116
|
} # '
|
117
117
|
|
118
118
|
#### Dependencies and requirements.
|
119
|
-
|
119
|
+
|
120
120
|
#s.add_dependency('log4r', '> 1.0.4')
|
121
121
|
#s.requirements << ""
|
122
|
-
|
122
|
+
|
123
123
|
#### Which files are to be included in this gem? Everything! (Except CVS directories.)
|
124
124
|
|
125
125
|
s.files = PKG_FILES.to_a
|
data/TAGS
CHANGED
@@ -6,7 +6,7 @@ module PagePage2,12
|
|
6
6
|
install.rb,29
|
7
7
|
def indir(newdir)indir7,68
|
8
8
|
|
9
|
-
lib/flexmock/argument_matchers.rb,
|
9
|
+
lib/flexmock/argument_matchers.rb,723
|
10
10
|
class FlexMockFlexMock14,338
|
11
11
|
class AnyMatcherAnyMatcher17,445
|
12
12
|
def ===(target)===18,464
|
@@ -19,13 +19,23 @@ class FlexMockFlexMock14,338
|
|
19
19
|
def initialize(&block)initialize45,1005
|
20
20
|
def ===(target)===48,1061
|
21
21
|
def inspectinspect51,1115
|
22
|
-
|
23
|
-
|
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
|
30
|
+
|
31
|
+
lib/flexmock/argument_types.rb,228
|
24
32
|
class FlexMockFlexMock14,350
|
25
33
|
module ArgumentTypesArgumentTypes21,643
|
26
34
|
def anyany23,726
|
27
35
|
def eq(obj)eq29,853
|
28
36
|
def on(&block)on36,1053
|
37
|
+
def hsh(hash)hsh42,1194
|
38
|
+
def ducktype(*methods)ducktype48,1371
|
29
39
|
|
30
40
|
lib/flexmock/base.rb,0
|
31
41
|
|
@@ -136,26 +146,27 @@ class FlexMockFlexMock15,363
|
|
136
146
|
def call(*args)call38,1207
|
137
147
|
def <<(expectation)<<46,1460
|
138
148
|
def find_expectation(*args) # :nodoc:find_expectation51,1584
|
139
|
-
def flexmock_verify # :nodoc:flexmock_verify62,
|
140
|
-
def defaultify_expectation(exp) # :nodoc:defaultify_expectation69,
|
141
|
-
def find_expectation_in(expectations, *args)find_expectation_in81,
|
149
|
+
def flexmock_verify # :nodoc:flexmock_verify62,1958
|
150
|
+
def defaultify_expectation(exp) # :nodoc:defaultify_expectation69,2169
|
151
|
+
def find_expectation_in(expectations, *args)find_expectation_in81,2450
|
142
152
|
|
143
|
-
lib/flexmock/mock_container.rb,
|
153
|
+
lib/flexmock/mock_container.rb,944
|
144
154
|
class FlexMockFlexMock16,399
|
145
155
|
module MockContainerMockContainer26,805
|
146
156
|
def flexmock_teardownflexmock_teardown31,989
|
147
157
|
def flexmock_verifyflexmock_verify38,1147
|
148
|
-
def
|
149
|
-
def
|
150
|
-
def
|
151
|
-
|
152
|
-
|
153
|
-
def
|
154
|
-
def
|
155
|
-
def
|
156
|
-
def
|
157
|
-
def
|
158
|
-
def
|
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,12113
|
159
170
|
|
160
171
|
lib/flexmock/noop.rb,0
|
161
172
|
|
@@ -193,14 +204,16 @@ class FlexMockFlexMock14,337
|
|
193
204
|
def detached?detached?281,9317
|
194
205
|
def new_name(old_name)new_name286,9425
|
195
206
|
|
196
|
-
lib/flexmock/rails/view_mocking.rb,
|
207
|
+
lib/flexmock/rails/view_mocking.rb,665
|
197
208
|
class FlexMockFlexMock3,20
|
198
209
|
module MockContainerMockContainer4,35
|
199
210
|
def rails_versionrails_version6,59
|
200
211
|
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_124
|
202
|
-
def should_render_view_after_version_124(template_name)should_render_view_after_version_124
|
203
|
-
def should_render_view_after_version_202(template_name)should_render_view_after_version_202
|
212
|
+
def should_render_view_prior_version_124(template_name) # :nodoc:should_render_view_prior_version_12443,1310
|
213
|
+
def should_render_view_after_version_124(template_name)should_render_view_after_version_12464,2093
|
214
|
+
def should_render_view_after_version_202(template_name)should_render_view_after_version_20288,3015
|
215
|
+
def should_render_view_22x(template_name)should_render_view_22x109,3813
|
216
|
+
def should_render_view_23x(template_name)should_render_view_23x129,4575
|
204
217
|
|
205
218
|
lib/flexmock/rails.rb,0
|
206
219
|
|
@@ -212,30 +225,6 @@ class FlexMockFlexMock14,347
|
|
212
225
|
def strict?strict?53,1675
|
213
226
|
def method_missing(sym, *args, &block)method_missing59,1805
|
214
227
|
|
215
|
-
lib/flexmock/rmock.rb,991
|
216
|
-
class ObjectObject4,59
|
217
|
-
def stub!(method)stub!5,72
|
218
|
-
def should_receive(method)should_receive8,157
|
219
|
-
class FlexMockFlexMock13,261
|
220
|
-
class GlobalContainerGlobalContainer14,276
|
221
|
-
module RMockEmulationRMockEmulation20,375
|
222
|
-
class SpecialArgSpecialArg23,436
|
223
|
-
def initialize(&block)initialize24,457
|
224
|
-
def apply(exp)apply27,519
|
225
|
-
class RMockExpecationProxyRMockExpecationProxy35,682
|
226
|
-
def initialize(expectation)initialize36,713
|
227
|
-
def with(*args)with39,792
|
228
|
-
def method_missing(sym, *args, &block)method_missing48,1053
|
229
|
-
class RMockProxyRMockProxy53,1163
|
230
|
-
def initialize(mock)initialize54,1184
|
231
|
-
def should_receive(method)should_receive57,1242
|
232
|
-
def should_not_receive(method)should_not_receive60,1353
|
233
|
-
def method_missing(sym, *args, &block)method_missing63,1469
|
234
|
-
def mock(name, options={})mock68,1598
|
235
|
-
def stub(name, options={})stub74,1742
|
236
|
-
def no_argsno_args78,1812
|
237
|
-
def any_argsany_args82,1851
|
238
|
-
|
239
228
|
lib/flexmock/rspec.rb,341
|
240
229
|
class FlexMockFlexMock14,337
|
241
230
|
class RSpecFrameworkAdapterRSpecFrameworkAdapter16,355
|
@@ -571,26 +560,6 @@ class TestRecordMode < Test::Unit::TestCaseTestRecordMode16,390
|
|
571
560
|
def test_strict_record_mode_requires_oncetest_strict_record_mode_requires_once136,3242
|
572
561
|
def test_strict_record_mode_can_not_failtest_strict_record_mode_can_not_fail149,3517
|
573
562
|
|
574
|
-
test/test_rmock.rb,1390
|
575
|
-
class RMockTest < Test::Unit::TestCaseRMockTest6,94
|
576
|
-
def test_can_mock_methodstest_can_mock_methods9,169
|
577
|
-
def test_mocks_require_their_methods_to_be_called_at_least_oncetest_mocks_require_their_methods_to_be_called_at_least_once15,262
|
578
|
-
def test_undefined_methods_failtest_undefined_methods_fail23,470
|
579
|
-
def test_null_object_optiontest_null_object_option30,597
|
580
|
-
def test_can_create_stubstest_can_create_stubs36,753
|
581
|
-
def test_stubs_dont_care_if_their_methods_arent_calledtest_stubs_dont_care_if_their_methods_arent_called41,928
|
582
|
-
def test_stubbing_partial_mockstest_stubbing_partial_mocks45,1024
|
583
|
-
def test_mocking_partial_mockstest_mocking_partial_mocks51,1152
|
584
|
-
def test_mocking_partial_mockstest_mocking_partial_mocks57,1288
|
585
|
-
def test_should_not_receive_where_it_is_not_receivedtest_should_not_receive_where_it_is_not_received65,1487
|
586
|
-
def test_should_not_receive_where_it_is_receivedtest_should_not_receive_where_it_is_received70,1604
|
587
|
-
def test_with_matching_argstest_with_matching_args79,1814
|
588
|
-
def test_with_mismatching_argstest_with_mismatching_args85,1918
|
589
|
-
def test_with_no_args_matchingtest_with_no_args_matching95,2130
|
590
|
-
def test_with_no_args_mismatchingtest_with_no_args_mismatching101,2240
|
591
|
-
def test_with_any_args_and_no_argstest_with_any_args_and_no_args109,2420
|
592
|
-
def test_with_any_args_and_1_argtest_with_any_args_and_1_arg115,2535
|
593
|
-
|
594
563
|
test/test_samples.rb,2164
|
595
564
|
class TestSamples < Test::Unit::TestCaseTestSamples17,378
|
596
565
|
def test_file_iotest_file_io25,748
|
@@ -650,119 +619,126 @@ class TestShouldIgnoreMissing < Test::Unit::TestCaseTestShouldIgnoreMissing16,
|
|
650
619
|
def test_not_calling_method_proc_will_fail_count_constraintstest_not_calling_method_proc_will_fail_count_constraints66,1693
|
651
620
|
def test_method_returns_do_nothing_proc_for_missing_methodstest_method_returns_do_nothing_proc_for_missing_methods75,1965
|
652
621
|
|
653
|
-
test/test_should_receive.rb,
|
622
|
+
test/test_should_receive.rb,11022
|
654
623
|
def mock_top_level_functionmock_top_level_function16,375
|
655
624
|
module KernelKernel20,416
|
656
625
|
def mock_kernel_functionmock_kernel_function21,430
|
657
|
-
class
|
658
|
-
def
|
659
|
-
def
|
660
|
-
|
661
|
-
def
|
662
|
-
def
|
663
|
-
def
|
664
|
-
def
|
665
|
-
def
|
666
|
-
def
|
667
|
-
def
|
668
|
-
def
|
669
|
-
def
|
670
|
-
def
|
671
|
-
def
|
672
|
-
def
|
673
|
-
def
|
674
|
-
def
|
675
|
-
def
|
676
|
-
|
677
|
-
def
|
678
|
-
def
|
679
|
-
|
680
|
-
def
|
681
|
-
def
|
682
|
-
def
|
683
|
-
def
|
684
|
-
def
|
685
|
-
def
|
686
|
-
def
|
687
|
-
def
|
688
|
-
def
|
689
|
-
def
|
690
|
-
def
|
691
|
-
def
|
692
|
-
def
|
693
|
-
def
|
694
|
-
def
|
695
|
-
def
|
696
|
-
def
|
697
|
-
def
|
698
|
-
def
|
699
|
-
def
|
700
|
-
def
|
701
|
-
def
|
702
|
-
def
|
703
|
-
def
|
704
|
-
def
|
705
|
-
def
|
706
|
-
def
|
707
|
-
def
|
708
|
-
def
|
709
|
-
def
|
710
|
-
def
|
711
|
-
def
|
712
|
-
def
|
713
|
-
def
|
714
|
-
def
|
715
|
-
def
|
716
|
-
def
|
717
|
-
def
|
718
|
-
def
|
719
|
-
def
|
720
|
-
def
|
721
|
-
def
|
722
|
-
def
|
723
|
-
def
|
724
|
-
def
|
725
|
-
def
|
726
|
-
def
|
727
|
-
def
|
728
|
-
def
|
729
|
-
def
|
730
|
-
def
|
731
|
-
def
|
732
|
-
def
|
733
|
-
def
|
734
|
-
def
|
735
|
-
def
|
736
|
-
def
|
737
|
-
def
|
738
|
-
def
|
739
|
-
def
|
740
|
-
def
|
741
|
-
def
|
742
|
-
def
|
743
|
-
def
|
744
|
-
def
|
745
|
-
def
|
746
|
-
def
|
747
|
-
def
|
748
|
-
def
|
749
|
-
def
|
750
|
-
def
|
751
|
-
def
|
752
|
-
def
|
753
|
-
def
|
754
|
-
def
|
755
|
-
def
|
756
|
-
def
|
757
|
-
def
|
758
|
-
def
|
759
|
-
def
|
760
|
-
def
|
761
|
-
def
|
762
|
-
|
763
|
-
def
|
764
|
-
|
765
|
-
def
|
626
|
+
class CatCat27,496
|
627
|
+
def purrpurr28,506
|
628
|
+
def meowmeow30,523
|
629
|
+
class TestFlexMockShoulds < Test::Unit::TestCaseTestFlexMockShoulds34,545
|
630
|
+
def test_defaultstest_defaults46,1089
|
631
|
+
def test_returns_with_valuetest_returns_with_value55,1257
|
632
|
+
def test_returns_with_multiple_valuestest_returns_with_multiple_values63,1426
|
633
|
+
def test_multiple_returnstest_multiple_returns74,1686
|
634
|
+
def test_returns_with_blocktest_returns_with_block85,1946
|
635
|
+
def test_block_example_from_readmetest_block_example_from_readme94,2149
|
636
|
+
def test_return_with_and_without_block_interleavedtest_return_with_and_without_block_interleaved104,2445
|
637
|
+
def test_and_returns_aliastest_and_returns_alias114,2725
|
638
|
+
def test_and_return_undefinedtest_and_return_undefined121,2862
|
639
|
+
def test_and_yield_will_continue_to_yield_the_same_valuetest_and_yield_will_continue_to_yield_the_same_value131,3211
|
640
|
+
def test_and_yield_with_multiple_values_yields_the_valuestest_and_yield_with_multiple_values_yields_the_values139,3457
|
641
|
+
def test_multiple_yields_are_done_sequentiallytest_multiple_yields_are_done_sequentially146,3667
|
642
|
+
def test_failure_if_no_block_giventest_failure_if_no_block_given155,3939
|
643
|
+
def test_failure_different_return_value_than_yield_returntest_failure_different_return_value_than_yield_return162,4122
|
644
|
+
def test_multiple_yieldstest_multiple_yields171,4408
|
645
|
+
def test_multiple_yields_will_yield_the_last_value_settest_multiple_yields_will_yield_the_last_value_set179,4646
|
646
|
+
def test_yielding_then_not_yielding_and_then_yielding_againtest_yielding_then_not_yielding_and_then_yielding_again190,5023
|
647
|
+
def test_yields_syntaxtest_yields_syntax201,5370
|
648
|
+
class MyError < RuntimeErrorMyError208,5515
|
649
|
+
def test_and_raises_with_exception_class_throws_exceptiontest_and_raises_with_exception_class_throws_exception211,5553
|
650
|
+
def test_and_raises_with_arguments_throws_exception_made_with_argstest_and_raises_with_arguments_throws_exception_made_with_args220,5762
|
651
|
+
def test_and_raises_with_a_specific_exception_throws_the_exceptiontest_and_raises_with_a_specific_exception_throws_the_exception230,6043
|
652
|
+
def test_raises_is_an_alias_for_and_raisetest_raises_is_an_alias_for_and_raise241,6313
|
653
|
+
def test_multiple_and_raise_clauses_will_be_done_sequentiallytest_multiple_and_raise_clauses_will_be_done_sequentially250,6518
|
654
|
+
def test_and_throw_will_throw_a_symboltest_and_throw_will_throw_a_symbol262,6916
|
655
|
+
def test_and_throw_with_expression_will_throwtest_and_throw_with_expression_will_throw273,7159
|
656
|
+
def test_throws_is_an_alias_for_and_throwtest_throws_is_an_alias_for_and_throw284,7441
|
657
|
+
def test_multiple_throws_will_be_done_sequentiallytest_multiple_throws_will_be_done_sequentially295,7716
|
658
|
+
def test_multiple_expectationstest_multiple_expectations307,8046
|
659
|
+
def test_with_no_args_with_no_argstest_with_no_args_with_no_args317,8283
|
660
|
+
def test_with_no_args_but_with_argstest_with_no_args_but_with_args324,8411
|
661
|
+
def test_with_any_argstest_with_any_args333,8610
|
662
|
+
def test_with_any_single_arg_matchingtest_with_any_single_arg_matching343,8788
|
663
|
+
def test_with_any_single_arg_nonmatchingtest_with_any_single_arg_nonmatching351,8981
|
664
|
+
def test_with_equal_arg_matchingtest_with_equal_arg_matching361,9216
|
665
|
+
def test_with_ducktype_arg_matchingtest_with_ducktype_arg_matching368,9379
|
666
|
+
def test_with_ducktype_arg_matching_no_matchtest_with_ducktype_arg_matching_no_match375,9558
|
667
|
+
def test_with_hash_matchingtest_with_hash_matching384,9782
|
668
|
+
def test_with_hash_non_matchingtest_with_hash_non_matching391,9970
|
669
|
+
def test_with_equal_arg_nonmatchingtest_with_equal_arg_nonmatching400,10190
|
670
|
+
def test_with_arbitrary_arg_matchingtest_with_arbitrary_arg_matching409,10427
|
671
|
+
def test_args_matching_with_regextest_args_matching_with_regex424,10847
|
672
|
+
def test_arg_matching_with_regex_matching_non_stringtest_arg_matching_with_regex_matching_non_string436,11174
|
673
|
+
def test_arg_matching_with_classtest_arg_matching_with_class443,11351
|
674
|
+
def test_arg_matching_with_no_matchtest_arg_matching_with_no_match454,11641
|
675
|
+
def test_arg_matching_with_string_doesnt_over_matchtest_arg_matching_with_string_doesnt_over_match463,11854
|
676
|
+
def test_block_arg_given_to_no_argstest_block_arg_given_to_no_args472,12073
|
677
|
+
def test_block_arg_given_to_matching_proctest_block_arg_given_to_matching_proc481,12277
|
678
|
+
def test_arg_matching_precedence_when_best_firsttest_arg_matching_precedence_when_best_first492,12562
|
679
|
+
def test_arg_matching_precedence_when_best_last_but_still_matches_firsttest_arg_matching_precedence_when_best_last_but_still_matches_first500,12771
|
680
|
+
def test_never_and_never_calledtest_never_and_never_called508,13003
|
681
|
+
def test_never_and_called_oncetest_never_and_called_once514,13118
|
682
|
+
def test_once_called_oncetest_once_called_once523,13314
|
683
|
+
def test_once_but_never_calledtest_once_but_never_called530,13448
|
684
|
+
def test_once_but_called_twicetest_once_but_called_twice538,13635
|
685
|
+
def test_twice_and_called_twicetest_twice_and_called_twice548,13854
|
686
|
+
def test_zero_or_more_called_zerotest_zero_or_more_called_zero556,14009
|
687
|
+
def test_zero_or_more_called_oncetest_zero_or_more_called_once562,14131
|
688
|
+
def test_zero_or_more_called_100test_zero_or_more_called_100569,14264
|
689
|
+
def test_timestest_times576,14410
|
690
|
+
def test_at_least_called_oncetest_at_least_called_once583,14551
|
691
|
+
def test_at_least_but_never_calledtest_at_least_but_never_called590,14698
|
692
|
+
def test_at_least_once_but_called_twicetest_at_least_once_but_called_twice598,14901
|
693
|
+
def test_at_least_and_exacttest_at_least_and_exact606,15072
|
694
|
+
def test_at_most_but_never_calledtest_at_most_but_never_called616,15302
|
695
|
+
def test_at_most_called_oncetest_at_most_called_once622,15438
|
696
|
+
def test_at_most_called_twicetest_at_most_called_twice629,15583
|
697
|
+
def test_at_most_and_at_least_called_nevertest_at_most_and_at_least_called_never639,15811
|
698
|
+
def test_at_most_and_at_least_called_oncetest_at_most_and_at_least_called_once647,16036
|
699
|
+
def test_at_most_and_at_least_called_twicetest_at_most_and_at_least_called_twice654,16209
|
700
|
+
def test_at_most_and_at_least_called_three_timestest_at_most_and_at_least_called_three_times662,16397
|
701
|
+
def test_call_counts_only_apply_to_matching_argstest_call_counts_only_apply_to_matching_args673,16675
|
702
|
+
def test_call_counts_only_apply_to_matching_args_with_mismatchtest_call_counts_only_apply_to_matching_args_with_mismatch685,16953
|
703
|
+
def test_ordered_calls_in_order_will_passtest_ordered_calls_in_order_will_pass701,17386
|
704
|
+
def test_ordered_calls_out_of_order_will_failtest_ordered_calls_out_of_order_will_fail711,17568
|
705
|
+
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
|
706
|
+
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
|
707
|
+
def test_unordered_calls_do_not_effect_ordered_testingtest_unordered_calls_do_not_effect_ordered_testing745,18408
|
708
|
+
def test_ordered_with_multiple_calls_will_passtest_ordered_with_multiple_calls_will_pass759,18678
|
709
|
+
def test_grouped_ordering_with_numberstest_grouped_ordering_with_numbers771,18893
|
710
|
+
def test_grouped_ordering_with_symbolstest_grouped_ordering_with_symbols786,19214
|
711
|
+
def test_explicit_ordering_mixed_with_implicit_ordering_should_not_overlaptest_explicit_ordering_mixed_with_implicit_ordering_should_not_overlap801,19576
|
712
|
+
def test_explicit_ordering_with_explicit_misorderstest_explicit_ordering_with_explicit_misorders811,19949
|
713
|
+
def test_ordering_with_explicit_no_args_matches_correctlytest_ordering_with_explicit_no_args_matches_correctly827,20480
|
714
|
+
def test_ordering_with_any_arg_matching_correctly_matchestest_ordering_with_any_arg_matching_correctly_matches839,20857
|
715
|
+
def test_ordering_between_mocks_is_not_normally_definedtest_ordering_between_mocks_is_not_normally_defined850,21169
|
716
|
+
def test_ordering_between_mocks_is_honored_for_global_orderingtest_ordering_between_mocks_is_honored_for_global_ordering862,21425
|
717
|
+
def test_expectation_formatingtest_expectation_formating874,21743
|
718
|
+
def test_multi_expectation_formattingtest_multi_expectation_formatting883,21971
|
719
|
+
def test_explicit_ordering_with_limits_allow_multiple_return_valuestest_explicit_ordering_with_limits_allow_multiple_return_values889,22134
|
720
|
+
def test_global_methods_can_be_mockedtest_global_methods_can_be_mocked908,22845
|
721
|
+
def test_kernel_methods_can_be_mockedtest_kernel_methods_can_be_mocked914,23029
|
722
|
+
def test_undefing_kernel_methods_dont_effect_other_mockstest_undefing_kernel_methods_dont_effect_other_mocks920,23207
|
723
|
+
def test_expectations_can_by_marked_as_defaulttest_expectations_can_by_marked_as_default928,23475
|
724
|
+
def test_default_expectations_are_search_in_the_proper_ordertest_default_expectations_are_search_in_the_proper_order934,23641
|
725
|
+
def test_expectations_with_count_constraints_can_by_marked_as_defaulttest_expectations_with_count_constraints_can_by_marked_as_default942,23948
|
726
|
+
def test_default_expectations_are_overridden_by_later_expectationstest_default_expectations_are_overridden_by_later_expectations950,24194
|
727
|
+
def test_default_expectations_can_be_changed_by_later_expectationstest_default_expectations_can_be_changed_by_later_expectations958,24422
|
728
|
+
def test_ordered_default_expectations_can_be_specifiedtest_ordered_default_expectations_can_be_specified969,24794
|
729
|
+
def test_ordered_default_expectations_can_be_overriddentest_ordered_default_expectations_can_be_overridden977,25045
|
730
|
+
def test_by_default_works_at_mock_leveltest_by_default_works_at_mock_level989,25316
|
731
|
+
def test_by_default_at_mock_level_does_nothing_with_no_expectationstest_by_default_at_mock_level_does_nothing_with_no_expectations1000,25591
|
732
|
+
def test_partial_mocks_can_have_default_expectationstest_partial_mocks_can_have_default_expectations1006,25736
|
733
|
+
def test_partial_mocks_can_have_default_expectations_overriddentest_partial_mocks_can_have_default_expectations_overridden1012,25917
|
734
|
+
def test_wicked_and_evil_tricks_with_by_default_are_thwartedtest_wicked_and_evil_tricks_with_by_default_are_thwarted1019,26165
|
735
|
+
def test_mocks_can_handle_multi_parameter_respond_tostest_mocks_can_handle_multi_parameter_respond_tos1031,26570
|
736
|
+
def test_can_mock_operatorstest_can_mock_operators1042,26917
|
737
|
+
def assert_operator(op, &block)assert_operator1071,27932
|
738
|
+
class TestFlexMockShouldsWithInclude < Test::Unit::TestCaseTestFlexMockShouldsWithInclude1079,28086
|
739
|
+
def test_include_enables_unqualified_arg_type_referencestest_include_enables_unqualified_arg_type_references1081,28180
|
740
|
+
class TestFlexMockArgTypesDontLeak < Test::Unit::TestCaseTestFlexMockArgTypesDontLeak1089,28344
|
741
|
+
def test_unqualified_arg_type_references_are_undefined_by_defaulttest_unqualified_arg_type_references_are_undefined_by_default1090,28402
|
766
742
|
|
767
743
|
test/test_tu_integration.rb,1570
|
768
744
|
class TestTuIntegrationFlexMockMethod < Test::Unit::TestCaseTestTuIntegrationFlexMockMethod15,352
|
@@ -29,7 +29,7 @@ class FlexMock
|
|
29
29
|
|
30
30
|
# Invoke the expectations for a given set of arguments.
|
31
31
|
#
|
32
|
-
# First, look for an expectation that matches the
|
32
|
+
# First, look for an expectation that matches the arguments and
|
33
33
|
# is eligible to be called. Failing that, look for a expectation
|
34
34
|
# that matches the arguments (at this point it will be ineligible,
|
35
35
|
# but at least we will get a good failure message). Finally,
|
@@ -56,7 +56,7 @@ class FlexMock
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
# Do the post test verification for this
|
59
|
+
# Do the post test verification for this director. Check all the
|
60
60
|
# expectations. Only check the default expecatations if there are
|
61
61
|
# no non-default expectations.
|
62
62
|
def flexmock_verify # :nodoc:
|
@@ -36,17 +36,20 @@ class FlexMock
|
|
36
36
|
|
37
37
|
# Perform verification on all mocks in the container.
|
38
38
|
def flexmock_verify
|
39
|
-
|
40
|
-
@flexmock_created_mocks.each do |m|
|
39
|
+
flexmock_created_mocks.each do |m|
|
41
40
|
m.flexmock_verify
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
44
|
+
# List of mocks created in this container
|
45
|
+
def flexmock_created_mocks
|
46
|
+
@flexmock_created_mocks ||= []
|
47
|
+
end
|
48
|
+
|
45
49
|
# Close all the mock objects in the container. Closing a mock object
|
46
50
|
# restores any original behavior that was displaced by the mock.
|
47
51
|
def flexmock_close
|
48
|
-
|
49
|
-
@flexmock_created_mocks.each do |m|
|
52
|
+
flexmock_created_mocks.each do |m|
|
50
53
|
m.flexmock_teardown
|
51
54
|
end
|
52
55
|
@flexmock_created_mocks = []
|
@@ -312,7 +315,7 @@ class FlexMock
|
|
312
315
|
end
|
313
316
|
end
|
314
317
|
|
315
|
-
METHOD_NAME_RE = /^([A-Za-z_][A-Za-z0-9_]*[=!?]?|\[\]=?||\*\*|<<|>>|<=>|[<>=]=|=~|===|[-+]@|[
|
318
|
+
METHOD_NAME_RE = /^([A-Za-z_][A-Za-z0-9_]*[=!?]?|\[\]=?||\*\*|<<|>>|<=>|[<>=]=|=~|===|[-+]@|[-+\*\/%&^|<>~`])$/
|
316
319
|
|
317
320
|
# Check that all the names in the list are valid method names.
|
318
321
|
def check_method_names(names)
|
data/test/test_should_receive.rb
CHANGED
@@ -1064,6 +1064,7 @@ class TestFlexMockShoulds < Test::Unit::TestCase
|
|
1064
1064
|
assert_operator(:>>) { |m| m >> :x }
|
1065
1065
|
assert_operator(:<=>) { |m| m <=> :x }
|
1066
1066
|
assert_operator(:=~) { |m| m =~ :x }
|
1067
|
+
assert_operator(:"`") { |m| m.`("command") } # `
|
1067
1068
|
end
|
1068
1069
|
|
1069
1070
|
private
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 49
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 8
|
9
|
+
- 7
|
10
|
+
version: 0.8.7
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Jim Weirich
|
@@ -9,18 +15,18 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date:
|
18
|
+
date: 2010-07-20 00:00:00 -04:00
|
13
19
|
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
16
|
-
description: FlexMock is a extremely simple mock object class compatible
|
22
|
+
description: "\n FlexMock is a extremely simple mock object class compatible\n with the Test::Unit framework. Although the FlexMock's\n interface is simple, it is very flexible.\n "
|
17
23
|
email: jim@weirichhouse.org
|
18
24
|
executables: []
|
19
25
|
|
20
26
|
extensions: []
|
21
27
|
|
22
28
|
extra_rdoc_files:
|
23
|
-
- README
|
29
|
+
- README.rdoc
|
24
30
|
- CHANGES
|
25
31
|
- doc/GoogleExample.rdoc
|
26
32
|
- doc/releases/flexmock-0.4.0.rdoc
|
@@ -44,7 +50,7 @@ extra_rdoc_files:
|
|
44
50
|
files:
|
45
51
|
- CHANGES
|
46
52
|
- Rakefile
|
47
|
-
- README
|
53
|
+
- README.rdoc
|
48
54
|
- TAGS
|
49
55
|
- lib/flexmock/argument_matchers.rb
|
50
56
|
- lib/flexmock/argument_types.rb
|
@@ -115,6 +121,8 @@ files:
|
|
115
121
|
- doc/releases/flexmock-0.8.5.rdoc
|
116
122
|
has_rdoc: true
|
117
123
|
homepage: http://flexmock.rubyforge.org
|
124
|
+
licenses: []
|
125
|
+
|
118
126
|
post_install_message:
|
119
127
|
rdoc_options:
|
120
128
|
- --title
|
@@ -125,23 +133,29 @@ rdoc_options:
|
|
125
133
|
require_paths:
|
126
134
|
- lib
|
127
135
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
128
137
|
requirements:
|
129
138
|
- - ">="
|
130
139
|
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
131
143
|
version: "0"
|
132
|
-
version:
|
133
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
134
146
|
requirements:
|
135
147
|
- - ">="
|
136
148
|
- !ruby/object:Gem::Version
|
149
|
+
hash: 3
|
150
|
+
segments:
|
151
|
+
- 0
|
137
152
|
version: "0"
|
138
|
-
version:
|
139
153
|
requirements: []
|
140
154
|
|
141
155
|
rubyforge_project:
|
142
|
-
rubygems_version: 1.3.
|
156
|
+
rubygems_version: 1.3.7
|
143
157
|
signing_key:
|
144
|
-
specification_version:
|
158
|
+
specification_version: 3
|
145
159
|
summary: Simple and Flexible Mock Objects for Testing
|
146
160
|
test_files: []
|
147
161
|
|