rspec-expectations 2.13.0 → 3.0.0
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.
- checksums.yaml +15 -0
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +413 -23
- data/License.txt +1 -0
- data/README.md +109 -80
- data/lib/rspec/{matchers → expectations}/configuration.rb +44 -14
- data/lib/rspec/expectations/expectation_target.rb +71 -38
- data/lib/rspec/expectations/fail_with.rb +12 -44
- data/lib/rspec/expectations/handler.rb +135 -35
- data/lib/rspec/expectations/minitest_integration.rb +16 -0
- data/lib/rspec/expectations/syntax.rb +60 -94
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/expectations.rb +46 -24
- data/lib/rspec/matchers/aliased_matcher.rb +41 -0
- data/lib/rspec/matchers/built_in/all.rb +78 -0
- data/lib/rspec/matchers/built_in/base_matcher.rb +63 -15
- data/lib/rspec/matchers/built_in/be.rb +170 -79
- data/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/lib/rspec/matchers/built_in/be_instance_of.rb +11 -3
- data/lib/rspec/matchers/built_in/be_kind_of.rb +5 -0
- data/lib/rspec/matchers/built_in/be_within.rb +40 -16
- data/lib/rspec/matchers/built_in/change.rb +275 -74
- data/lib/rspec/matchers/built_in/compound.rb +122 -0
- data/lib/rspec/matchers/built_in/contain_exactly.rb +256 -0
- data/lib/rspec/matchers/built_in/cover.rb +3 -0
- data/lib/rspec/matchers/built_in/eq.rb +60 -6
- data/lib/rspec/matchers/built_in/eql.rb +17 -5
- data/lib/rspec/matchers/built_in/equal.rb +55 -21
- data/lib/rspec/matchers/built_in/exist.rb +74 -10
- data/lib/rspec/matchers/built_in/has.rb +71 -15
- data/lib/rspec/matchers/built_in/include.rb +58 -29
- data/lib/rspec/matchers/built_in/match.rb +19 -1
- data/lib/rspec/matchers/built_in/operators.rb +119 -0
- data/lib/rspec/matchers/built_in/output.rb +150 -0
- data/lib/rspec/matchers/built_in/raise_error.rb +91 -33
- data/lib/rspec/matchers/built_in/respond_to.rb +42 -20
- data/lib/rspec/matchers/built_in/satisfy.rb +19 -3
- data/lib/rspec/matchers/built_in/start_and_end_with.rb +54 -18
- data/lib/rspec/matchers/built_in/throw_symbol.rb +38 -8
- data/lib/rspec/matchers/built_in/yield.rb +237 -55
- data/lib/rspec/matchers/built_in.rb +45 -33
- data/lib/rspec/matchers/composable.rb +179 -0
- data/lib/rspec/matchers/dsl.rb +362 -5
- data/lib/rspec/matchers/generated_descriptions.rb +13 -6
- data/lib/rspec/matchers/matcher_delegator.rb +37 -0
- data/lib/rspec/matchers/pretty.rb +33 -20
- data/lib/rspec/matchers.rb +450 -227
- data.tar.gz.sig +1 -0
- metadata +100 -215
- metadata.gz.sig +0 -0
- data/features/README.md +0 -49
- data/features/Upgrade.md +0 -53
- data/features/built_in_matchers/README.md +0 -90
- data/features/built_in_matchers/be.feature +0 -175
- data/features/built_in_matchers/be_within.feature +0 -48
- data/features/built_in_matchers/cover.feature +0 -47
- data/features/built_in_matchers/end_with.feature +0 -48
- data/features/built_in_matchers/equality.feature +0 -139
- data/features/built_in_matchers/exist.feature +0 -45
- data/features/built_in_matchers/expect_change.feature +0 -59
- data/features/built_in_matchers/expect_error.feature +0 -144
- data/features/built_in_matchers/have.feature +0 -109
- data/features/built_in_matchers/include.feature +0 -174
- data/features/built_in_matchers/match.feature +0 -52
- data/features/built_in_matchers/operators.feature +0 -227
- data/features/built_in_matchers/predicates.feature +0 -137
- data/features/built_in_matchers/respond_to.feature +0 -84
- data/features/built_in_matchers/satisfy.feature +0 -33
- data/features/built_in_matchers/start_with.feature +0 -48
- data/features/built_in_matchers/throw_symbol.feature +0 -91
- data/features/built_in_matchers/types.feature +0 -116
- data/features/built_in_matchers/yield.feature +0 -146
- data/features/custom_matchers/access_running_example.feature +0 -53
- data/features/custom_matchers/define_diffable_matcher.feature +0 -27
- data/features/custom_matchers/define_matcher.feature +0 -368
- data/features/custom_matchers/define_matcher_outside_rspec.feature +0 -38
- data/features/custom_matchers/define_matcher_with_fluent_interface.feature +0 -24
- data/features/customized_message.feature +0 -22
- data/features/diffing.feature +0 -85
- data/features/implicit_docstrings.feature +0 -52
- data/features/step_definitions/additional_cli_steps.rb +0 -22
- data/features/support/env.rb +0 -5
- data/features/syntax_configuration.feature +0 -68
- data/features/test_frameworks/test_unit.feature +0 -46
- data/lib/rspec/expectations/deprecation.rb +0 -38
- data/lib/rspec/expectations/differ.rb +0 -115
- data/lib/rspec/expectations/errors.rb +0 -9
- data/lib/rspec/expectations/extensions/array.rb +0 -9
- data/lib/rspec/expectations/extensions/object.rb +0 -39
- data/lib/rspec/expectations/extensions.rb +0 -2
- data/lib/rspec/matchers/be_close.rb +0 -9
- data/lib/rspec/matchers/built_in/have.rb +0 -108
- data/lib/rspec/matchers/built_in/match_array.rb +0 -51
- data/lib/rspec/matchers/compatibility.rb +0 -14
- data/lib/rspec/matchers/extensions/instance_eval_with_args.rb +0 -39
- data/lib/rspec/matchers/matcher.rb +0 -300
- data/lib/rspec/matchers/method_missing.rb +0 -12
- data/lib/rspec/matchers/operator_matcher.rb +0 -109
- data/lib/rspec-expectations.rb +0 -1
- data/spec/rspec/expectations/differ_spec.rb +0 -170
- data/spec/rspec/expectations/expectation_target_spec.rb +0 -75
- data/spec/rspec/expectations/extensions/kernel_spec.rb +0 -67
- data/spec/rspec/expectations/fail_with_spec.rb +0 -95
- data/spec/rspec/expectations/handler_spec.rb +0 -206
- data/spec/rspec/expectations/syntax_spec.rb +0 -97
- data/spec/rspec/matchers/base_matcher_spec.rb +0 -62
- data/spec/rspec/matchers/be_close_spec.rb +0 -22
- data/spec/rspec/matchers/be_instance_of_spec.rb +0 -63
- data/spec/rspec/matchers/be_kind_of_spec.rb +0 -41
- data/spec/rspec/matchers/be_spec.rb +0 -516
- data/spec/rspec/matchers/be_within_spec.rb +0 -129
- data/spec/rspec/matchers/change_spec.rb +0 -542
- data/spec/rspec/matchers/configuration_spec.rb +0 -238
- data/spec/rspec/matchers/cover_spec.rb +0 -69
- data/spec/rspec/matchers/description_generation_spec.rb +0 -176
- data/spec/rspec/matchers/dsl_spec.rb +0 -57
- data/spec/rspec/matchers/eq_spec.rb +0 -60
- data/spec/rspec/matchers/eql_spec.rb +0 -41
- data/spec/rspec/matchers/equal_spec.rb +0 -78
- data/spec/rspec/matchers/exist_spec.rb +0 -124
- data/spec/rspec/matchers/has_spec.rb +0 -122
- data/spec/rspec/matchers/have_spec.rb +0 -445
- data/spec/rspec/matchers/include_matcher_integration_spec.rb +0 -30
- data/spec/rspec/matchers/include_spec.rb +0 -531
- data/spec/rspec/matchers/match_array_spec.rb +0 -194
- data/spec/rspec/matchers/match_spec.rb +0 -61
- data/spec/rspec/matchers/matcher_spec.rb +0 -471
- data/spec/rspec/matchers/matchers_spec.rb +0 -37
- data/spec/rspec/matchers/method_missing_spec.rb +0 -28
- data/spec/rspec/matchers/operator_matcher_spec.rb +0 -223
- data/spec/rspec/matchers/raise_error_spec.rb +0 -395
- data/spec/rspec/matchers/respond_to_spec.rb +0 -292
- data/spec/rspec/matchers/satisfy_spec.rb +0 -44
- data/spec/rspec/matchers/start_with_end_with_spec.rb +0 -186
- data/spec/rspec/matchers/throw_symbol_spec.rb +0 -116
- data/spec/rspec/matchers/yield_spec.rb +0 -437
- data/spec/spec_helper.rb +0 -54
- data/spec/support/classes.rb +0 -56
- data/spec/support/in_sub_process.rb +0 -38
- data/spec/support/matchers.rb +0 -22
- data/spec/support/ruby_version.rb +0 -10
- data/spec/support/shared_examples.rb +0 -13
data.tar.gz.sig
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
�t�!��Y��#��G����h�[��-[+;K��\���k�ڜ�Ҍ�d�;�W&n7
|
metadata
CHANGED
|
@@ -1,225 +1,195 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-expectations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
version: 2.13.0
|
|
4
|
+
version: 3.0.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Steven Baker
|
|
9
8
|
- David Chelimsky
|
|
9
|
+
- Myron Marston
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
|
-
cert_chain:
|
|
13
|
-
|
|
12
|
+
cert_chain:
|
|
13
|
+
- !binary |-
|
|
14
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURqakNDQW5hZ0F3SUJB
|
|
15
|
+
Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREJHTVJJd0VBWURWUVFEREFseWMz
|
|
16
|
+
QmwKWXkxa1pYWXhHekFaQmdvSmtpYUprL0lzWkFFWkZndG5iMjluYkdWbmIz
|
|
17
|
+
VndjekVUTUJFR0NnbVNKb21UOGl4awpBUmtXQTJOdmJUQWVGdzB4TXpFeE1E
|
|
18
|
+
Y3hPVFF5TlRsYUZ3MHhOREV4TURjeE9UUXlOVGxhTUVZeEVqQVFCZ05WCkJB
|
|
19
|
+
TU1DWEp6Y0dWakxXUmxkakViTUJrR0NnbVNKb21UOGl4a0FSa1dDMmR2YjJk
|
|
20
|
+
c1pXZHZkWEJ6TVJNd0VRWUsKQ1pJbWlaUHlMR1FCR1JZRFkyOXRNSUlCSWpB
|
|
21
|
+
TkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQQpuaENlWm91
|
|
22
|
+
RExYV081NW5vK0VkWk5DdGpYamZKUTFYOVRiUGN2QkREMjlPeXBJVWNlMmgv
|
|
23
|
+
VmRLWEIyZ0k3WkhzCkY1TmtQZ2dzbFRFckdGbVdBdElpdXI3dTk0M1JWcUhP
|
|
24
|
+
c3lvSXN5MDY1RjlmQ3RyeWtrQSsyMmVsdlREaGE0SXoKUlVDdnVoUTNrbGF0
|
|
25
|
+
WWs0akYrY0d0MWpOT05OVmRMT2l5MGJNeW52Y003aG9WUTJBb213R3MrY0VP
|
|
26
|
+
V1EvNGRrRApKY05WM3FmekY1UUJjVEQyMzcyWE5NNTNiMjVuWVZRU1gyS0g1
|
|
27
|
+
RkY3QmhsS3lvdjMzYk9tMmdBOU0rbVdJdWpXCnFna3l4VmxmcmxFK1pCZ1Yz
|
|
28
|
+
d1huMUNvamcxTHBUcTM1eU9Bcmd3aW95cnd3bFpaSlI5am9OOXMvbkRrbGZy
|
|
29
|
+
NUEKK2R5RVRqRmM2Y21FUFdacnQyY0pCUUlEQVFBQm80R0dNSUdETUFrR0Ex
|
|
30
|
+
VWRFd1FDTUFBd0N3WURWUjBQQkFRRApBZ1N3TUIwR0ExVWREZ1FXQkJTVytX
|
|
31
|
+
RDdobjFzd0oxQTdpOHRidUZldU5DSkNqQWtCZ05WSFJFRUhUQWJnUmx5CmMz
|
|
32
|
+
QmxZeTFrWlhaQVoyOXZaMnhsWjI5MWNITXVZMjl0TUNRR0ExVWRFZ1FkTUJ1
|
|
33
|
+
QkdYSnpjR1ZqTFdSbGRrQm4KYjI5bmJHVm5iM1Z3Y3k1amIyMHdEUVlKS29a
|
|
34
|
+
SWh2Y05BUUVGQlFBRGdnRUJBSDI3akFaOHNEN3ZuWHVwajZZKwpCYUJkZkh0
|
|
35
|
+
Q2tGYXNsTEowYUt1TURJVlh3WXVLZnFvVzE1Y1pQRExtU0lFQnVRRk0zbHc2
|
|
36
|
+
ZC9oRUVMNFVvMmpaCkZ2dG1INU94aWZQRHpGeVV0Q0w0eXA2cWdOZS9YZjZz
|
|
37
|
+
RHNSZzZGbUtjcGdxQ3dOT21zVmlhZjBMUFNVSC9HWVEKM1Rlb3o4UUNhRGJE
|
|
38
|
+
N0FLc2ZmVDdlRHJuYkhuS3dlTzFYZGVtUkpDOTh1L3lZeG5Hek1TV0tFc24w
|
|
39
|
+
OWV0QmxaOQo3SDY3azVaM3VmNmNmTFpnVG9XTDZ6U2h6WlkzTnVuNXI3M1lz
|
|
40
|
+
TmYyL1FaT2U0VVplNHZmR3ZuNmJhdzUzeXM5CjF5SEMxQWNTWXB2aTJkQWJP
|
|
41
|
+
aUhUNWlRRitrcm00d3NlOEtjdFhnVE5uak1zSEVvR0t1bEpTMi9zWmw5MGpj
|
|
42
|
+
Q3oKbXVBPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
|
43
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
|
14
44
|
dependencies:
|
|
15
45
|
- !ruby/object:Gem::Dependency
|
|
46
|
+
name: rspec-support
|
|
47
|
+
requirement: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ~>
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: 3.0.0
|
|
52
|
+
type: :runtime
|
|
53
|
+
prerelease: false
|
|
16
54
|
version_requirements: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
- - ~>
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: 3.0.0
|
|
59
|
+
- !ruby/object:Gem::Dependency
|
|
60
|
+
name: diff-lcs
|
|
61
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
62
|
requirements:
|
|
18
63
|
- - ! '>='
|
|
19
64
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: 1.
|
|
65
|
+
version: 1.2.0
|
|
21
66
|
- - <
|
|
22
67
|
- !ruby/object:Gem::Version
|
|
23
68
|
version: '2.0'
|
|
24
|
-
|
|
69
|
+
type: :runtime
|
|
25
70
|
prerelease: false
|
|
26
|
-
|
|
27
|
-
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
28
72
|
requirements:
|
|
29
73
|
- - ! '>='
|
|
30
74
|
- !ruby/object:Gem::Version
|
|
31
|
-
version: 1.
|
|
75
|
+
version: 1.2.0
|
|
32
76
|
- - <
|
|
33
77
|
- !ruby/object:Gem::Version
|
|
34
78
|
version: '2.0'
|
|
35
|
-
none: false
|
|
36
|
-
type: :runtime
|
|
37
79
|
- !ruby/object:Gem::Dependency
|
|
38
|
-
|
|
80
|
+
name: rake
|
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
|
39
82
|
requirements:
|
|
40
83
|
- - ~>
|
|
41
84
|
- !ruby/object:Gem::Version
|
|
42
85
|
version: 10.0.0
|
|
43
|
-
|
|
86
|
+
type: :development
|
|
44
87
|
prerelease: false
|
|
45
|
-
|
|
46
|
-
requirement: !ruby/object:Gem::Requirement
|
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
47
89
|
requirements:
|
|
48
90
|
- - ~>
|
|
49
91
|
- !ruby/object:Gem::Version
|
|
50
92
|
version: 10.0.0
|
|
51
|
-
none: false
|
|
52
|
-
type: :development
|
|
53
93
|
- !ruby/object:Gem::Dependency
|
|
54
|
-
|
|
94
|
+
name: cucumber
|
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
|
55
96
|
requirements:
|
|
56
97
|
- - ~>
|
|
57
98
|
- !ruby/object:Gem::Version
|
|
58
|
-
version: 1.
|
|
59
|
-
|
|
99
|
+
version: '1.3'
|
|
100
|
+
type: :development
|
|
60
101
|
prerelease: false
|
|
61
|
-
|
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
- - ~>
|
|
105
|
+
- !ruby/object:Gem::Version
|
|
106
|
+
version: '1.3'
|
|
107
|
+
- !ruby/object:Gem::Dependency
|
|
108
|
+
name: aruba
|
|
62
109
|
requirement: !ruby/object:Gem::Requirement
|
|
63
110
|
requirements:
|
|
64
111
|
- - ~>
|
|
65
112
|
- !ruby/object:Gem::Version
|
|
66
|
-
version:
|
|
67
|
-
none: false
|
|
113
|
+
version: '0.5'
|
|
68
114
|
type: :development
|
|
69
|
-
|
|
115
|
+
prerelease: false
|
|
70
116
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
117
|
requirements:
|
|
72
118
|
- - ~>
|
|
73
119
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: 0.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
name: aruba
|
|
120
|
+
version: '0.5'
|
|
121
|
+
- !ruby/object:Gem::Dependency
|
|
122
|
+
name: minitest
|
|
78
123
|
requirement: !ruby/object:Gem::Requirement
|
|
79
124
|
requirements:
|
|
80
125
|
- - ~>
|
|
81
126
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
83
|
-
none: false
|
|
127
|
+
version: '5.2'
|
|
84
128
|
type: :development
|
|
85
|
-
|
|
86
|
-
|
|
129
|
+
prerelease: false
|
|
130
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
131
|
+
requirements:
|
|
132
|
+
- - ~>
|
|
133
|
+
- !ruby/object:Gem::Version
|
|
134
|
+
version: '5.2'
|
|
135
|
+
description: rspec-expectations provides a simple, readable API to express expected
|
|
136
|
+
outcomes of a code example.
|
|
137
|
+
email: rspec@googlegroups.com
|
|
87
138
|
executables: []
|
|
88
139
|
extensions: []
|
|
89
140
|
extra_rdoc_files: []
|
|
90
141
|
files:
|
|
91
|
-
- lib/rspec-expectations.rb
|
|
92
142
|
- lib/rspec/expectations.rb
|
|
93
|
-
- lib/rspec/expectations/
|
|
94
|
-
- lib/rspec/expectations/differ.rb
|
|
95
|
-
- lib/rspec/expectations/errors.rb
|
|
143
|
+
- lib/rspec/expectations/configuration.rb
|
|
96
144
|
- lib/rspec/expectations/expectation_target.rb
|
|
97
|
-
- lib/rspec/expectations/extensions.rb
|
|
98
|
-
- lib/rspec/expectations/extensions/array.rb
|
|
99
|
-
- lib/rspec/expectations/extensions/object.rb
|
|
100
145
|
- lib/rspec/expectations/fail_with.rb
|
|
101
146
|
- lib/rspec/expectations/handler.rb
|
|
147
|
+
- lib/rspec/expectations/minitest_integration.rb
|
|
102
148
|
- lib/rspec/expectations/syntax.rb
|
|
103
149
|
- lib/rspec/expectations/version.rb
|
|
104
150
|
- lib/rspec/matchers.rb
|
|
105
|
-
- lib/rspec/matchers/
|
|
151
|
+
- lib/rspec/matchers/aliased_matcher.rb
|
|
106
152
|
- lib/rspec/matchers/built_in.rb
|
|
153
|
+
- lib/rspec/matchers/built_in/all.rb
|
|
107
154
|
- lib/rspec/matchers/built_in/base_matcher.rb
|
|
108
155
|
- lib/rspec/matchers/built_in/be.rb
|
|
156
|
+
- lib/rspec/matchers/built_in/be_between.rb
|
|
109
157
|
- lib/rspec/matchers/built_in/be_instance_of.rb
|
|
110
158
|
- lib/rspec/matchers/built_in/be_kind_of.rb
|
|
111
159
|
- lib/rspec/matchers/built_in/be_within.rb
|
|
112
160
|
- lib/rspec/matchers/built_in/change.rb
|
|
161
|
+
- lib/rspec/matchers/built_in/compound.rb
|
|
162
|
+
- lib/rspec/matchers/built_in/contain_exactly.rb
|
|
113
163
|
- lib/rspec/matchers/built_in/cover.rb
|
|
114
164
|
- lib/rspec/matchers/built_in/eq.rb
|
|
115
165
|
- lib/rspec/matchers/built_in/eql.rb
|
|
116
166
|
- lib/rspec/matchers/built_in/equal.rb
|
|
117
167
|
- lib/rspec/matchers/built_in/exist.rb
|
|
118
168
|
- lib/rspec/matchers/built_in/has.rb
|
|
119
|
-
- lib/rspec/matchers/built_in/have.rb
|
|
120
169
|
- lib/rspec/matchers/built_in/include.rb
|
|
121
170
|
- lib/rspec/matchers/built_in/match.rb
|
|
122
|
-
- lib/rspec/matchers/built_in/
|
|
171
|
+
- lib/rspec/matchers/built_in/operators.rb
|
|
172
|
+
- lib/rspec/matchers/built_in/output.rb
|
|
123
173
|
- lib/rspec/matchers/built_in/raise_error.rb
|
|
124
174
|
- lib/rspec/matchers/built_in/respond_to.rb
|
|
125
175
|
- lib/rspec/matchers/built_in/satisfy.rb
|
|
126
176
|
- lib/rspec/matchers/built_in/start_and_end_with.rb
|
|
127
177
|
- lib/rspec/matchers/built_in/throw_symbol.rb
|
|
128
178
|
- lib/rspec/matchers/built_in/yield.rb
|
|
129
|
-
- lib/rspec/matchers/
|
|
130
|
-
- lib/rspec/matchers/configuration.rb
|
|
179
|
+
- lib/rspec/matchers/composable.rb
|
|
131
180
|
- lib/rspec/matchers/dsl.rb
|
|
132
|
-
- lib/rspec/matchers/extensions/instance_eval_with_args.rb
|
|
133
181
|
- lib/rspec/matchers/generated_descriptions.rb
|
|
134
|
-
- lib/rspec/matchers/
|
|
135
|
-
- lib/rspec/matchers/method_missing.rb
|
|
136
|
-
- lib/rspec/matchers/operator_matcher.rb
|
|
182
|
+
- lib/rspec/matchers/matcher_delegator.rb
|
|
137
183
|
- lib/rspec/matchers/pretty.rb
|
|
138
184
|
- README.md
|
|
139
185
|
- License.txt
|
|
140
186
|
- Changelog.md
|
|
141
187
|
- .yardopts
|
|
142
188
|
- .document
|
|
143
|
-
- features/README.md
|
|
144
|
-
- features/Upgrade.md
|
|
145
|
-
- features/built_in_matchers/README.md
|
|
146
|
-
- features/built_in_matchers/be.feature
|
|
147
|
-
- features/built_in_matchers/be_within.feature
|
|
148
|
-
- features/built_in_matchers/cover.feature
|
|
149
|
-
- features/built_in_matchers/end_with.feature
|
|
150
|
-
- features/built_in_matchers/equality.feature
|
|
151
|
-
- features/built_in_matchers/exist.feature
|
|
152
|
-
- features/built_in_matchers/expect_change.feature
|
|
153
|
-
- features/built_in_matchers/expect_error.feature
|
|
154
|
-
- features/built_in_matchers/have.feature
|
|
155
|
-
- features/built_in_matchers/include.feature
|
|
156
|
-
- features/built_in_matchers/match.feature
|
|
157
|
-
- features/built_in_matchers/operators.feature
|
|
158
|
-
- features/built_in_matchers/predicates.feature
|
|
159
|
-
- features/built_in_matchers/respond_to.feature
|
|
160
|
-
- features/built_in_matchers/satisfy.feature
|
|
161
|
-
- features/built_in_matchers/start_with.feature
|
|
162
|
-
- features/built_in_matchers/throw_symbol.feature
|
|
163
|
-
- features/built_in_matchers/types.feature
|
|
164
|
-
- features/built_in_matchers/yield.feature
|
|
165
|
-
- features/custom_matchers/access_running_example.feature
|
|
166
|
-
- features/custom_matchers/define_diffable_matcher.feature
|
|
167
|
-
- features/custom_matchers/define_matcher.feature
|
|
168
|
-
- features/custom_matchers/define_matcher_outside_rspec.feature
|
|
169
|
-
- features/custom_matchers/define_matcher_with_fluent_interface.feature
|
|
170
|
-
- features/customized_message.feature
|
|
171
|
-
- features/diffing.feature
|
|
172
|
-
- features/implicit_docstrings.feature
|
|
173
|
-
- features/step_definitions/additional_cli_steps.rb
|
|
174
|
-
- features/support/env.rb
|
|
175
|
-
- features/syntax_configuration.feature
|
|
176
|
-
- features/test_frameworks/test_unit.feature
|
|
177
|
-
- spec/rspec/expectations/differ_spec.rb
|
|
178
|
-
- spec/rspec/expectations/expectation_target_spec.rb
|
|
179
|
-
- spec/rspec/expectations/extensions/kernel_spec.rb
|
|
180
|
-
- spec/rspec/expectations/fail_with_spec.rb
|
|
181
|
-
- spec/rspec/expectations/handler_spec.rb
|
|
182
|
-
- spec/rspec/expectations/syntax_spec.rb
|
|
183
|
-
- spec/rspec/matchers/base_matcher_spec.rb
|
|
184
|
-
- spec/rspec/matchers/be_close_spec.rb
|
|
185
|
-
- spec/rspec/matchers/be_instance_of_spec.rb
|
|
186
|
-
- spec/rspec/matchers/be_kind_of_spec.rb
|
|
187
|
-
- spec/rspec/matchers/be_spec.rb
|
|
188
|
-
- spec/rspec/matchers/be_within_spec.rb
|
|
189
|
-
- spec/rspec/matchers/change_spec.rb
|
|
190
|
-
- spec/rspec/matchers/configuration_spec.rb
|
|
191
|
-
- spec/rspec/matchers/cover_spec.rb
|
|
192
|
-
- spec/rspec/matchers/description_generation_spec.rb
|
|
193
|
-
- spec/rspec/matchers/dsl_spec.rb
|
|
194
|
-
- spec/rspec/matchers/eq_spec.rb
|
|
195
|
-
- spec/rspec/matchers/eql_spec.rb
|
|
196
|
-
- spec/rspec/matchers/equal_spec.rb
|
|
197
|
-
- spec/rspec/matchers/exist_spec.rb
|
|
198
|
-
- spec/rspec/matchers/has_spec.rb
|
|
199
|
-
- spec/rspec/matchers/have_spec.rb
|
|
200
|
-
- spec/rspec/matchers/include_matcher_integration_spec.rb
|
|
201
|
-
- spec/rspec/matchers/include_spec.rb
|
|
202
|
-
- spec/rspec/matchers/match_array_spec.rb
|
|
203
|
-
- spec/rspec/matchers/match_spec.rb
|
|
204
|
-
- spec/rspec/matchers/matcher_spec.rb
|
|
205
|
-
- spec/rspec/matchers/matchers_spec.rb
|
|
206
|
-
- spec/rspec/matchers/method_missing_spec.rb
|
|
207
|
-
- spec/rspec/matchers/operator_matcher_spec.rb
|
|
208
|
-
- spec/rspec/matchers/raise_error_spec.rb
|
|
209
|
-
- spec/rspec/matchers/respond_to_spec.rb
|
|
210
|
-
- spec/rspec/matchers/satisfy_spec.rb
|
|
211
|
-
- spec/rspec/matchers/start_with_end_with_spec.rb
|
|
212
|
-
- spec/rspec/matchers/throw_symbol_spec.rb
|
|
213
|
-
- spec/rspec/matchers/yield_spec.rb
|
|
214
|
-
- spec/spec_helper.rb
|
|
215
|
-
- spec/support/classes.rb
|
|
216
|
-
- spec/support/in_sub_process.rb
|
|
217
|
-
- spec/support/matchers.rb
|
|
218
|
-
- spec/support/ruby_version.rb
|
|
219
|
-
- spec/support/shared_examples.rb
|
|
220
189
|
homepage: http://github.com/rspec/rspec-expectations
|
|
221
190
|
licenses:
|
|
222
191
|
- MIT
|
|
192
|
+
metadata: {}
|
|
223
193
|
post_install_message:
|
|
224
194
|
rdoc_options:
|
|
225
195
|
- --charset=UTF-8
|
|
@@ -229,102 +199,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
229
199
|
requirements:
|
|
230
200
|
- - ! '>='
|
|
231
201
|
- !ruby/object:Gem::Version
|
|
232
|
-
version:
|
|
233
|
-
segments:
|
|
234
|
-
- 0
|
|
235
|
-
hash: 3249637945894736858
|
|
236
|
-
none: false
|
|
202
|
+
version: 1.8.7
|
|
237
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
204
|
requirements:
|
|
239
205
|
- - ! '>='
|
|
240
206
|
- !ruby/object:Gem::Version
|
|
241
207
|
version: '0'
|
|
242
|
-
segments:
|
|
243
|
-
- 0
|
|
244
|
-
hash: 3249637945894736858
|
|
245
|
-
none: false
|
|
246
208
|
requirements: []
|
|
247
209
|
rubyforge_project: rspec
|
|
248
|
-
rubygems_version:
|
|
210
|
+
rubygems_version: 2.0.7
|
|
249
211
|
signing_key:
|
|
250
|
-
specification_version:
|
|
251
|
-
summary: rspec-expectations-
|
|
252
|
-
test_files:
|
|
253
|
-
- features/README.md
|
|
254
|
-
- features/Upgrade.md
|
|
255
|
-
- features/built_in_matchers/README.md
|
|
256
|
-
- features/built_in_matchers/be.feature
|
|
257
|
-
- features/built_in_matchers/be_within.feature
|
|
258
|
-
- features/built_in_matchers/cover.feature
|
|
259
|
-
- features/built_in_matchers/end_with.feature
|
|
260
|
-
- features/built_in_matchers/equality.feature
|
|
261
|
-
- features/built_in_matchers/exist.feature
|
|
262
|
-
- features/built_in_matchers/expect_change.feature
|
|
263
|
-
- features/built_in_matchers/expect_error.feature
|
|
264
|
-
- features/built_in_matchers/have.feature
|
|
265
|
-
- features/built_in_matchers/include.feature
|
|
266
|
-
- features/built_in_matchers/match.feature
|
|
267
|
-
- features/built_in_matchers/operators.feature
|
|
268
|
-
- features/built_in_matchers/predicates.feature
|
|
269
|
-
- features/built_in_matchers/respond_to.feature
|
|
270
|
-
- features/built_in_matchers/satisfy.feature
|
|
271
|
-
- features/built_in_matchers/start_with.feature
|
|
272
|
-
- features/built_in_matchers/throw_symbol.feature
|
|
273
|
-
- features/built_in_matchers/types.feature
|
|
274
|
-
- features/built_in_matchers/yield.feature
|
|
275
|
-
- features/custom_matchers/access_running_example.feature
|
|
276
|
-
- features/custom_matchers/define_diffable_matcher.feature
|
|
277
|
-
- features/custom_matchers/define_matcher.feature
|
|
278
|
-
- features/custom_matchers/define_matcher_outside_rspec.feature
|
|
279
|
-
- features/custom_matchers/define_matcher_with_fluent_interface.feature
|
|
280
|
-
- features/customized_message.feature
|
|
281
|
-
- features/diffing.feature
|
|
282
|
-
- features/implicit_docstrings.feature
|
|
283
|
-
- features/step_definitions/additional_cli_steps.rb
|
|
284
|
-
- features/support/env.rb
|
|
285
|
-
- features/syntax_configuration.feature
|
|
286
|
-
- features/test_frameworks/test_unit.feature
|
|
287
|
-
- spec/rspec/expectations/differ_spec.rb
|
|
288
|
-
- spec/rspec/expectations/expectation_target_spec.rb
|
|
289
|
-
- spec/rspec/expectations/extensions/kernel_spec.rb
|
|
290
|
-
- spec/rspec/expectations/fail_with_spec.rb
|
|
291
|
-
- spec/rspec/expectations/handler_spec.rb
|
|
292
|
-
- spec/rspec/expectations/syntax_spec.rb
|
|
293
|
-
- spec/rspec/matchers/base_matcher_spec.rb
|
|
294
|
-
- spec/rspec/matchers/be_close_spec.rb
|
|
295
|
-
- spec/rspec/matchers/be_instance_of_spec.rb
|
|
296
|
-
- spec/rspec/matchers/be_kind_of_spec.rb
|
|
297
|
-
- spec/rspec/matchers/be_spec.rb
|
|
298
|
-
- spec/rspec/matchers/be_within_spec.rb
|
|
299
|
-
- spec/rspec/matchers/change_spec.rb
|
|
300
|
-
- spec/rspec/matchers/configuration_spec.rb
|
|
301
|
-
- spec/rspec/matchers/cover_spec.rb
|
|
302
|
-
- spec/rspec/matchers/description_generation_spec.rb
|
|
303
|
-
- spec/rspec/matchers/dsl_spec.rb
|
|
304
|
-
- spec/rspec/matchers/eq_spec.rb
|
|
305
|
-
- spec/rspec/matchers/eql_spec.rb
|
|
306
|
-
- spec/rspec/matchers/equal_spec.rb
|
|
307
|
-
- spec/rspec/matchers/exist_spec.rb
|
|
308
|
-
- spec/rspec/matchers/has_spec.rb
|
|
309
|
-
- spec/rspec/matchers/have_spec.rb
|
|
310
|
-
- spec/rspec/matchers/include_matcher_integration_spec.rb
|
|
311
|
-
- spec/rspec/matchers/include_spec.rb
|
|
312
|
-
- spec/rspec/matchers/match_array_spec.rb
|
|
313
|
-
- spec/rspec/matchers/match_spec.rb
|
|
314
|
-
- spec/rspec/matchers/matcher_spec.rb
|
|
315
|
-
- spec/rspec/matchers/matchers_spec.rb
|
|
316
|
-
- spec/rspec/matchers/method_missing_spec.rb
|
|
317
|
-
- spec/rspec/matchers/operator_matcher_spec.rb
|
|
318
|
-
- spec/rspec/matchers/raise_error_spec.rb
|
|
319
|
-
- spec/rspec/matchers/respond_to_spec.rb
|
|
320
|
-
- spec/rspec/matchers/satisfy_spec.rb
|
|
321
|
-
- spec/rspec/matchers/start_with_end_with_spec.rb
|
|
322
|
-
- spec/rspec/matchers/throw_symbol_spec.rb
|
|
323
|
-
- spec/rspec/matchers/yield_spec.rb
|
|
324
|
-
- spec/spec_helper.rb
|
|
325
|
-
- spec/support/classes.rb
|
|
326
|
-
- spec/support/in_sub_process.rb
|
|
327
|
-
- spec/support/matchers.rb
|
|
328
|
-
- spec/support/ruby_version.rb
|
|
329
|
-
- spec/support/shared_examples.rb
|
|
212
|
+
specification_version: 4
|
|
213
|
+
summary: rspec-expectations-3.0.0
|
|
214
|
+
test_files: []
|
|
330
215
|
has_rdoc:
|
metadata.gz.sig
ADDED
|
Binary file
|
data/features/README.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
rspec-expectations is used to define expected outcomes.
|
|
2
|
-
|
|
3
|
-
describe Account do
|
|
4
|
-
it "has a balance of zero when first created" do
|
|
5
|
-
Account.new.balance.should eq(Money.new(0))
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
## Basic structure
|
|
10
|
-
|
|
11
|
-
The basic structure of an rspec expectation is:
|
|
12
|
-
|
|
13
|
-
actual.should matcher(expected)
|
|
14
|
-
actual.should_not matcher(expected)
|
|
15
|
-
|
|
16
|
-
## `should` and `should_not`
|
|
17
|
-
|
|
18
|
-
`rspec-expectations` adds `should` and `should_not` to every object in
|
|
19
|
-
the system. These methods each accept a matcher as an argument. This allows
|
|
20
|
-
each matcher to work in a positive or negative mode:
|
|
21
|
-
|
|
22
|
-
5.should eq(5)
|
|
23
|
-
5.should_not eq(4)
|
|
24
|
-
|
|
25
|
-
## What is a matcher?
|
|
26
|
-
|
|
27
|
-
A Matcher is any object that responds to the following methods:
|
|
28
|
-
|
|
29
|
-
matches?(actual)
|
|
30
|
-
failure_message_for_should
|
|
31
|
-
|
|
32
|
-
These methods are also part of the matcher protocol, but are optional:
|
|
33
|
-
|
|
34
|
-
does_not_match?(actual)
|
|
35
|
-
failure_message_for_should_not
|
|
36
|
-
description
|
|
37
|
-
|
|
38
|
-
RSpec ships with a number of built-in matchers and a DSL for writing custom
|
|
39
|
-
matchers.
|
|
40
|
-
|
|
41
|
-
## Issues
|
|
42
|
-
|
|
43
|
-
The documentation for rspec-expectations is a work in progress. We'll be adding
|
|
44
|
-
Cucumber features over time, and clarifying existing ones. If you have
|
|
45
|
-
specific features you'd like to see added, find the existing documentation
|
|
46
|
-
incomplete or confusing, or, better yet, wish to write a missing Cucumber
|
|
47
|
-
feature yourself, please [submit an
|
|
48
|
-
issue](http://github.com/rspec/rspec-expectations/issues) or a [pull
|
|
49
|
-
request](http://github.com/rspec/rspec-expectations).
|
data/features/Upgrade.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Upgrade to rspec-expectations-2.0
|
|
2
|
-
|
|
3
|
-
## What's new
|
|
4
|
-
|
|
5
|
-
### New `eq` matcher.
|
|
6
|
-
|
|
7
|
-
`RSpec::Matchers` now offers you two approaches to differentiating between
|
|
8
|
-
object identity. You can use the rspec-1 approach:
|
|
9
|
-
|
|
10
|
-
actual.should == expected # object equality
|
|
11
|
-
actual.should equal(expected) # object identity
|
|
12
|
-
|
|
13
|
-
... or, if you prefer:
|
|
14
|
-
|
|
15
|
-
actual.should eq(expected) # object equality
|
|
16
|
-
actual.should be(expected) # object identity
|
|
17
|
-
|
|
18
|
-
## What's been removed
|
|
19
|
-
|
|
20
|
-
### simple_matcher
|
|
21
|
-
|
|
22
|
-
Use RSpec::Matchers.define instead. For example, if you had:
|
|
23
|
-
|
|
24
|
-
def eat_cheese
|
|
25
|
-
simple_matcher("eat cheese") do |actual|
|
|
26
|
-
actual.eat?(:cheese)
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
Change it to:
|
|
31
|
-
|
|
32
|
-
RSpec::Matchers.define :eat_cheese do
|
|
33
|
-
match do |actual|
|
|
34
|
-
actual.eat?(:cheese)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
### wrap_expectation
|
|
39
|
-
|
|
40
|
-
Use RSpec::Matchers.define instead.
|
|
41
|
-
|
|
42
|
-
RSpec::Matchers.define :eat_cheese do
|
|
43
|
-
match do |actual|
|
|
44
|
-
actual.should eat?(:cheese)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
RSpec::Matchers.define :eat_cheese do
|
|
49
|
-
include MyCheesyAssertions
|
|
50
|
-
match_unless_raises Test::Unit::AssertionFailedError do |actual|
|
|
51
|
-
assert_eats_chesse actual
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Built-in Matchers
|
|
2
|
-
|
|
3
|
-
Here is a list of matchers that ship with rspec-expectations. Each matcher
|
|
4
|
-
can be used with `should` or `should_not` e.g.
|
|
5
|
-
|
|
6
|
-
result.should eq(3)
|
|
7
|
-
list.should_not be_empty
|
|
8
|
-
|
|
9
|
-
## Object identity
|
|
10
|
-
|
|
11
|
-
actual.should be(expected) # passes if actual.equal?(expected)
|
|
12
|
-
|
|
13
|
-
## Object equivalence
|
|
14
|
-
|
|
15
|
-
actual.should eq(expected) # passes if actual == expected
|
|
16
|
-
|
|
17
|
-
## Optional APIs for identity/equivalence
|
|
18
|
-
|
|
19
|
-
actual.should == expected # passes if actual == expected
|
|
20
|
-
actual.should eql(expected) # passes if actual.eql?(expected)
|
|
21
|
-
actual.should equal(expected) # passes if actual.equal?(expected)
|
|
22
|
-
|
|
23
|
-
# NOTE: this can't work in Ruby 1.8, so we don't support it at all:
|
|
24
|
-
# actual.should != expected
|
|
25
|
-
# The reason is that Ruby 1.8 parses it as:
|
|
26
|
-
# !(actual.should.==(expected)),
|
|
27
|
-
# so by the time RSpec sees it it has no way to know that it's
|
|
28
|
-
# been negated. Use either of these instead:
|
|
29
|
-
# actual.should_not eq(expected)
|
|
30
|
-
# actual.should_not == expected
|
|
31
|
-
|
|
32
|
-
## Comparisons
|
|
33
|
-
|
|
34
|
-
actual.should be > expected
|
|
35
|
-
actual.should be >= expected
|
|
36
|
-
actual.should be <= expected
|
|
37
|
-
actual.should be < expected
|
|
38
|
-
actual.should =~ /expression/
|
|
39
|
-
actual.should match(/expression/)
|
|
40
|
-
actual.should be_within(delta).of(expected)
|
|
41
|
-
|
|
42
|
-
## Types/classes
|
|
43
|
-
|
|
44
|
-
actual.should be_instance_of(expected)
|
|
45
|
-
actual.should be_kind_of(expected)
|
|
46
|
-
|
|
47
|
-
## Truthiness and existentialism
|
|
48
|
-
|
|
49
|
-
actual.should be_true # passes if actual is truthy (not nil or false)
|
|
50
|
-
actual.should be_false # passes if actual is falsy (nil or false)
|
|
51
|
-
actual.should be_nil # passes if actual is nil
|
|
52
|
-
actual.should be # passes if actual is truthy (not nil or false)
|
|
53
|
-
|
|
54
|
-
## Expecting errors
|
|
55
|
-
|
|
56
|
-
expect { ... }.to raise_error
|
|
57
|
-
expect { ... }.to raise_error(ErrorClass)
|
|
58
|
-
expect { ... }.to raise_error("message")
|
|
59
|
-
expect { ... }.to raise_error(ErrorClass, "message")
|
|
60
|
-
|
|
61
|
-
## Expecting throws
|
|
62
|
-
|
|
63
|
-
expect { ... }.to throw_symbol
|
|
64
|
-
expect { ... }.to throw_symbol(:symbol)
|
|
65
|
-
expect { ... }.to throw_symbol(:symbol, 'value')
|
|
66
|
-
|
|
67
|
-
## Predicate matchers
|
|
68
|
-
|
|
69
|
-
actual.should be_xxx # passes if actual.xxx?
|
|
70
|
-
actual.should have_xxx(:arg) # passes if actual.has_xxx?(:arg)
|
|
71
|
-
|
|
72
|
-
### Examples
|
|
73
|
-
|
|
74
|
-
[].should be_empty # passes because [].empty? returns true
|
|
75
|
-
{ :a => 1 }.should have_key(:a) # passes because the hash has the key :a
|
|
76
|
-
|
|
77
|
-
## Collection membership
|
|
78
|
-
|
|
79
|
-
actual.should include(expected)
|
|
80
|
-
|
|
81
|
-
### Examples
|
|
82
|
-
|
|
83
|
-
[1,2,3].should include(1)
|
|
84
|
-
[1,2,3].should include(1, 2)
|
|
85
|
-
{:a => 'b'}.should include(:a => 'b')
|
|
86
|
-
"this string".should include("is str")
|
|
87
|
-
|
|
88
|
-
## Ranges (1.9 only)
|
|
89
|
-
|
|
90
|
-
(1..10).should cover(3)
|