bond-spy 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bond_reconcile.py +224 -134
- data/bond.gemspec +2 -1
- data/lib/bond.rb +53 -35
- data/lib/bond/targetable.rb +9 -3
- data/lib/bond/version.rb +1 -1
- data/spec/bond_spec.rb +16 -0
- data/spec/bond_targetable_spec.rb +13 -0
- data/spec/test_observations/bond_spec/Bond_with_agents_should_call_doers_before_returning_result.json +4 -4
- data/spec/test_observations/bond_spec/Bond_with_agents_should_call_the_function_passed_as_result_if_it_is_callable.json +9 -9
- data/spec/test_observations/bond_spec/Bond_with_agents_should_correctly_call_a_single_doer_if_filter_criteria_are_met.json +4 -4
- data/spec/test_observations/bond_spec/Bond_with_agents_should_correctly_call_multiple_doers.json +5 -5
- data/spec/test_observations/bond_spec/Bond_with_agents_should_not_call_doers_of_overriden_agents.json +2 -2
- data/spec/test_observations/bond_spec/Bond_with_agents_should_skip_saving_observations_when_specified.json +18 -0
- data/spec/test_observations/bond_spec/Bond_with_agents_should_throw_an_exception_if_specified_by_agent.json +3 -3
- data/spec/test_observations/bond_spec/Bond_with_agents_should_throw_the_result_of_the_value_passed_to_exception_if_callable.json +4 -4
- data/spec/test_observations/bond_spec/Bond_with_agents_should_work_with_multiple_agents_for_different_spy_points.json +9 -9
- data/spec/test_observations/bond_spec/Bond_with_agents_with_filters_should_respect_combinations_of_filters.json +19 -19
- data/spec/test_observations/bond_spec/Bond_with_agents_with_filters_should_respect_function_filters.json +6 -6
- data/spec/test_observations/bond_spec/Bond_with_agents_with_filters_should_respect_single_key_value_filters_of_all_types.json +51 -51
- data/spec/test_observations/bond_spec/Bond_without_any_agents_should_correctly_log_nested_hashes_and_arrays_with_hash_sorting.json +22 -22
- data/spec/test_observations/bond_spec/Bond_without_any_agents_should_correctly_log_some_normal_arguments_with_a_spy_point_name.json +6 -6
- data/spec/test_observations/bond_spec/Bond_without_any_agents_should_correctly_log_some_normal_arguments_without_a_spy_point_name.json +4 -4
- data/spec/test_observations/bond_targetable_spec/BondTargetable_correctly_continues_to_the_method_when_agent_result_continue_is_returned.json +4 -4
- data/spec/test_observations/bond_targetable_spec/BondTargetable_correctly_continues_to_the_method_when_agent_result_none_is_returned.json +6 -6
- data/spec/test_observations/bond_targetable_spec/BondTargetable_correctly_spies_private_methods.json +2 -2
- data/spec/test_observations/bond_targetable_spec/BondTargetable_correctly_spies_protected_methods.json +2 -2
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_argument_types_correctly_spies_on_a_class_method.json +3 -3
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_argument_types_correctly_spies_on_a_normal_method.json +3 -3
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_argument_types_correctly_spies_on_all_optional_keyword_arguments.json +4 -4
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_argument_types_correctly_spies_on_variable_keyword_arguments.json +12 -12
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_spy_point_parameters_correctly_ignores_excluded_keys.json +4 -4
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_spy_point_parameters_correctly_mocks_when_one_is_specified.json +4 -4
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_different_spy_point_parameters_correctly_respects_mock_only.json +17 -0
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_modules_correctly_spies_on_included_module_methods.json +2 -2
- data/spec/test_observations/bond_targetable_spec/BondTargetable_with_modules_correctly_spies_on_module_methods.json +3 -3
- data/tutorials/binary_search_tree/bst_spec.rb +1 -5
- data/tutorials/binary_search_tree/run_tests.sh +1 -1
- data/tutorials/heat_watcher/heat_watcher.rb +2 -2
- data/tutorials/heat_watcher/heat_watcher_spec.rb +8 -13
- data/tutorials/heat_watcher/test_observations/heat_watcher_spec/HeatWatcher_should_properly_report_critical_errors.json +7 -49
- data/tutorials/heat_watcher/test_observations/heat_watcher_spec/HeatWatcher_should_properly_report_warnings_and_switch_back_to_OK_status.json +9 -63
- metadata +20 -2
@@ -1,23 +1,23 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
3
|
+
"__spy_point__": "my_point_1"
|
4
4
|
},
|
5
5
|
{
|
6
|
-
|
7
|
-
|
6
|
+
"__spy_point__": "point_1_return",
|
7
|
+
"return_value": "mock result"
|
8
8
|
},
|
9
9
|
{
|
10
|
-
|
10
|
+
"__spy_point__": "my_point_2"
|
11
11
|
},
|
12
12
|
{
|
13
|
-
|
14
|
-
|
13
|
+
"__spy_point__": "point_2_return",
|
14
|
+
"return_value": "mock result 2"
|
15
15
|
},
|
16
16
|
{
|
17
|
-
|
17
|
+
"__spy_point__": "my_point_1"
|
18
18
|
},
|
19
19
|
{
|
20
|
-
|
21
|
-
|
20
|
+
"__spy_point__": "point_1_return_2",
|
21
|
+
"return_value": "mock result"
|
22
22
|
}
|
23
23
|
]
|
@@ -1,37 +1,37 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
"__spy_point__": "my_point",
|
4
|
+
"req_key": "foo",
|
5
|
+
"req_key2": "bar",
|
6
|
+
"req_key3": "value"
|
7
7
|
},
|
8
8
|
{
|
9
|
-
|
9
|
+
"result": "agent_result_none"
|
10
10
|
},
|
11
11
|
{
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
"__spy_point__": "my_point",
|
13
|
+
"req_key": "foo",
|
14
|
+
"req_key2": "value",
|
15
|
+
"req_key3": "foovaluebar"
|
16
16
|
},
|
17
17
|
{
|
18
|
-
|
18
|
+
"result": "mocked"
|
19
19
|
},
|
20
20
|
{
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
"__spy_point__": "my_point",
|
22
|
+
"req_key": "foo",
|
23
|
+
"req_key2": "value",
|
24
|
+
"req_key3": "lacking"
|
25
25
|
},
|
26
26
|
{
|
27
|
-
|
27
|
+
"result": "agent_result_none"
|
28
28
|
},
|
29
29
|
{
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
"__spy_point__": "my_point",
|
31
|
+
"req_key2": "value",
|
32
|
+
"req_key3": "value"
|
33
33
|
},
|
34
34
|
{
|
35
|
-
|
35
|
+
"result": "agent_result_none"
|
36
36
|
}
|
37
37
|
]
|
@@ -1,16 +1,16 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
3
|
+
"__spy_point__": "my_point",
|
4
|
+
"my_key": 5
|
5
5
|
},
|
6
6
|
{
|
7
|
-
|
7
|
+
"result": "agent_result_none"
|
8
8
|
},
|
9
9
|
{
|
10
|
-
|
11
|
-
|
10
|
+
"__spy_point__": "my_point",
|
11
|
+
"my_key": 10
|
12
12
|
},
|
13
13
|
{
|
14
|
-
|
14
|
+
"result": "mocked"
|
15
15
|
}
|
16
16
|
]
|
@@ -1,121 +1,121 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
3
|
+
"__spy_point__": "my_point",
|
4
|
+
"obs_name": "value"
|
5
5
|
},
|
6
6
|
{
|
7
|
-
|
7
|
+
"result": "mocked"
|
8
8
|
},
|
9
9
|
{
|
10
|
-
|
11
|
-
|
10
|
+
"__spy_point__": "my_point",
|
11
|
+
"obs_name": "not value"
|
12
12
|
},
|
13
13
|
{
|
14
|
-
|
14
|
+
"result": "agent_result_none"
|
15
15
|
},
|
16
16
|
{
|
17
|
-
|
18
|
-
|
17
|
+
"__spy_point__": "my_point_eq",
|
18
|
+
"obs_name": "value"
|
19
19
|
},
|
20
20
|
{
|
21
|
-
|
21
|
+
"result": "mocked"
|
22
22
|
},
|
23
23
|
{
|
24
|
-
|
25
|
-
|
24
|
+
"__spy_point__": "my_point_eq",
|
25
|
+
"obs_name": "not value"
|
26
26
|
},
|
27
27
|
{
|
28
|
-
|
28
|
+
"result": "agent_result_none"
|
29
29
|
},
|
30
30
|
{
|
31
|
-
|
32
|
-
|
31
|
+
"__spy_point__": "my_point_exact",
|
32
|
+
"obs_name": "value"
|
33
33
|
},
|
34
34
|
{
|
35
|
-
|
35
|
+
"result": "mocked"
|
36
36
|
},
|
37
37
|
{
|
38
|
-
|
39
|
-
|
38
|
+
"__spy_point__": "my_point_exact",
|
39
|
+
"obs_name": "not value"
|
40
40
|
},
|
41
41
|
{
|
42
|
-
|
42
|
+
"result": "agent_result_none"
|
43
43
|
},
|
44
44
|
{
|
45
|
-
|
46
|
-
|
45
|
+
"__spy_point__": "my_point_startswith",
|
46
|
+
"obs_name": "value"
|
47
47
|
},
|
48
48
|
{
|
49
|
-
|
49
|
+
"result": "mocked"
|
50
50
|
},
|
51
51
|
{
|
52
|
-
|
53
|
-
|
52
|
+
"__spy_point__": "my_point_startswith",
|
53
|
+
"obs_name": "not value"
|
54
54
|
},
|
55
55
|
{
|
56
|
-
|
56
|
+
"result": "agent_result_none"
|
57
57
|
},
|
58
58
|
{
|
59
|
-
|
60
|
-
|
59
|
+
"__spy_point__": "my_point_startswith",
|
60
|
+
"obs_name": "value not"
|
61
61
|
},
|
62
62
|
{
|
63
|
-
|
63
|
+
"result": "mocked"
|
64
64
|
},
|
65
65
|
{
|
66
|
-
|
67
|
-
|
66
|
+
"__spy_point__": "my_point_endswith",
|
67
|
+
"obs_name": "value"
|
68
68
|
},
|
69
69
|
{
|
70
|
-
|
70
|
+
"result": "mocked"
|
71
71
|
},
|
72
72
|
{
|
73
|
-
|
74
|
-
|
73
|
+
"__spy_point__": "my_point_endswith",
|
74
|
+
"obs_name": "not value"
|
75
75
|
},
|
76
76
|
{
|
77
|
-
|
77
|
+
"result": "mocked"
|
78
78
|
},
|
79
79
|
{
|
80
|
-
|
81
|
-
|
80
|
+
"__spy_point__": "my_point_endswith",
|
81
|
+
"obs_name": "value not"
|
82
82
|
},
|
83
83
|
{
|
84
|
-
|
84
|
+
"result": "agent_result_none"
|
85
85
|
},
|
86
86
|
{
|
87
|
-
|
88
|
-
|
87
|
+
"__spy_point__": "my_point_contains",
|
88
|
+
"obs_name": "value"
|
89
89
|
},
|
90
90
|
{
|
91
|
-
|
91
|
+
"result": "mocked"
|
92
92
|
},
|
93
93
|
{
|
94
|
-
|
95
|
-
|
94
|
+
"__spy_point__": "my_point_contains",
|
95
|
+
"obs_name": "not value"
|
96
96
|
},
|
97
97
|
{
|
98
|
-
|
98
|
+
"result": "mocked"
|
99
99
|
},
|
100
100
|
{
|
101
|
-
|
102
|
-
|
101
|
+
"__spy_point__": "my_point_contains",
|
102
|
+
"obs_name": "value not"
|
103
103
|
},
|
104
104
|
{
|
105
|
-
|
105
|
+
"result": "mocked"
|
106
106
|
},
|
107
107
|
{
|
108
|
-
|
109
|
-
|
108
|
+
"__spy_point__": "my_point_contains",
|
109
|
+
"obs_name": "not value not"
|
110
110
|
},
|
111
111
|
{
|
112
|
-
|
112
|
+
"result": "mocked"
|
113
113
|
},
|
114
114
|
{
|
115
|
-
|
116
|
-
|
115
|
+
"__spy_point__": "my_point_contains",
|
116
|
+
"obs_name": "foobar"
|
117
117
|
},
|
118
118
|
{
|
119
|
-
|
119
|
+
"result": "agent_result_none"
|
120
120
|
}
|
121
121
|
]
|
@@ -1,31 +1,31 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
},
|
10
|
-
"key2": [
|
11
|
-
{
|
12
|
-
"key1": "baz",
|
13
|
-
"key2": "foo",
|
14
|
-
"key3": "bar"
|
3
|
+
"key1": {
|
4
|
+
"h1key1": [
|
5
|
+
"hello",
|
6
|
+
"world"
|
7
|
+
],
|
8
|
+
"h1key2": "hi"
|
15
9
|
},
|
16
|
-
"
|
17
|
-
|
18
|
-
|
10
|
+
"key2": [
|
11
|
+
{
|
12
|
+
"key1": "baz",
|
13
|
+
"key2": "foo",
|
14
|
+
"key3": "bar"
|
15
|
+
},
|
16
|
+
"array3",
|
17
|
+
"array2"
|
18
|
+
]
|
19
19
|
},
|
20
20
|
{
|
21
|
-
|
22
|
-
|
23
|
-
"key3": {
|
24
|
-
"key1": "bar",
|
25
|
-
"key2": "foo",
|
21
|
+
"__spy_point__": "point_name",
|
22
|
+
"key1": "value 1",
|
26
23
|
"key3": {
|
27
|
-
|
24
|
+
"key1": "bar",
|
25
|
+
"key2": "foo",
|
26
|
+
"key3": {
|
27
|
+
"hkey": "hello world"
|
28
|
+
}
|
28
29
|
}
|
29
|
-
}
|
30
30
|
}
|
31
31
|
]
|
@@ -1,12 +1,12 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
"__spy_point__": "my_point_name",
|
4
|
+
"spy_key": 1,
|
5
|
+
"spy_key_2": "string value",
|
6
|
+
"spy_key_3": 1.4000
|
7
7
|
},
|
8
8
|
{
|
9
|
-
|
10
|
-
|
9
|
+
"__spy_point__": "second_point",
|
10
|
+
"spy_key": "string value 2"
|
11
11
|
}
|
12
12
|
]
|
@@ -1,14 +1,14 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
|
4
|
-
|
3
|
+
"__spy_point__": "spy_return",
|
4
|
+
"arg1": "value"
|
5
5
|
},
|
6
6
|
{
|
7
|
-
|
8
|
-
|
7
|
+
"__spy_point__": "spy_return.result",
|
8
|
+
"result": "return"
|
9
9
|
},
|
10
10
|
{
|
11
|
-
|
12
|
-
|
11
|
+
"__spy_point__": "return value",
|
12
|
+
"ret": "return"
|
13
13
|
}
|
14
14
|
]
|