rr 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/README +5 -0
- data/Rakefile +1 -1
- data/examples/rr/double/double_register_scenario_example.rb +1 -1
- data/examples/rr/double/double_verify_example.rb +1 -1
- data/examples/rr/expectations/times_called_expectation/times_called_expectation_example.rb +0 -5
- data/examples/rr/expectations/times_called_expectation/times_called_expectation_integer_example.rb +2 -1
- data/examples/rr/expectations/times_called_expectation/times_called_expectation_proc_example.rb +2 -2
- data/examples/rr/expectations/times_called_expectation/times_called_expectation_range_example.rb +2 -1
- data/examples/rr/extensions/instance_methods_creator_example.rb +54 -9
- data/examples/rr/scenario_creator_example.rb +32 -42
- data/examples/rr/scenario_definition_example.rb +503 -0
- data/examples/rr/scenario_example.rb +48 -32
- data/examples/rr/scenario_method_proxy_example.rb +2 -2
- data/examples/rr/space/space_verify_example.rb +3 -3
- data/lib/rr.rb +4 -0
- data/lib/rr/expectations/times_called_expectation.rb +4 -5
- data/lib/rr/extensions/instance_methods.rb +16 -0
- data/lib/rr/scenario.rb +60 -82
- data/lib/rr/scenario_creator.rb +67 -56
- data/lib/rr/scenario_definition.rb +277 -0
- data/lib/rr/scenario_definition_builder.rb +43 -0
- data/lib/rr/space.rb +7 -2
- metadata +5 -2
data/lib/rr/space.rb
CHANGED
@@ -40,12 +40,17 @@ module RR
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# Creates and registers a Scenario to be verified.
|
43
|
-
def scenario(double)
|
44
|
-
scenario = Scenario.new(self, double)
|
43
|
+
def scenario(double, definition = scenario_definition)
|
44
|
+
scenario = Scenario.new(self, double, definition)
|
45
|
+
scenario.definition.scenario = scenario
|
45
46
|
double.register_scenario scenario
|
46
47
|
scenario
|
47
48
|
end
|
48
49
|
|
50
|
+
def scenario_definition
|
51
|
+
ScenarioDefinition.new(self)
|
52
|
+
end
|
53
|
+
|
49
54
|
# Reuses or creates, if none exists, a Double for the passed
|
50
55
|
# in object and method_name.
|
51
56
|
# When a Double is created, it binds the dispatcher to the
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.3
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rr
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2007-07-
|
6
|
+
version: 0.3.4
|
7
|
+
date: 2007-07-25 00:00:00 -07:00
|
8
8
|
summary: RR (Double Ruby) is a double framework that features a rich selection of double techniques and a terse syntax. http://xunitpatterns.com/Test%20Double.html
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -35,7 +35,9 @@ files:
|
|
35
35
|
- lib/rr.rb
|
36
36
|
- lib/rr/scenario_method_proxy.rb
|
37
37
|
- lib/rr/scenario.rb
|
38
|
+
- lib/rr/scenario_definition.rb
|
38
39
|
- lib/rr/hash_with_object_id_key.rb
|
40
|
+
- lib/rr/scenario_definition_builder.rb
|
39
41
|
- lib/rr/scenario_matches.rb
|
40
42
|
- lib/rr/space.rb
|
41
43
|
- lib/rr/double.rb
|
@@ -74,6 +76,7 @@ files:
|
|
74
76
|
- examples/example_helper.rb
|
75
77
|
- examples/test_unit_example_suite.rb
|
76
78
|
- examples/high_level_example.rb
|
79
|
+
- examples/rr/scenario_definition_example.rb
|
77
80
|
- examples/rr/scenario_method_proxy_example.rb
|
78
81
|
- examples/rr/scenario_example.rb
|
79
82
|
- examples/rr/scenario_creator_example.rb
|