rspec-expectations 2.13.0 → 2.99.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
- data/Changelog.md +204 -23
- data/README.md +43 -87
- data/features/README.md +10 -10
- data/features/built_in_matchers/README.md +41 -41
- data/features/built_in_matchers/be.feature +40 -40
- data/features/built_in_matchers/be_within.feature +3 -3
- data/features/built_in_matchers/expect_change.feature +6 -6
- data/features/built_in_matchers/expect_error.feature +2 -2
- data/features/built_in_matchers/start_with.feature +1 -1
- data/features/built_in_matchers/throw_symbol.feature +11 -11
- data/features/built_in_matchers/yield.feature +18 -3
- data/features/custom_matchers/define_diffable_matcher.feature +1 -1
- data/features/custom_matchers/define_matcher_outside_rspec.feature +6 -6
- data/features/custom_matchers/define_matcher_with_fluent_interface.feature +1 -1
- data/features/customized_message.feature +1 -1
- data/features/diffing.feature +1 -1
- data/features/step_definitions/additional_cli_steps.rb +10 -0
- data/features/support/env.rb +10 -1
- data/features/support/rubinius.rb +6 -0
- data/features/syntax_configuration.feature +3 -0
- data/features/test_frameworks/test_unit.feature +55 -17
- data/lib/rspec/expectations/caller_filter.rb +60 -0
- data/lib/rspec/{matchers → expectations}/configuration.rb +5 -3
- data/lib/rspec/expectations/deprecation.rb +20 -31
- data/lib/rspec/expectations/differ.rb +48 -9
- data/lib/rspec/expectations/expectation_target.rb +81 -15
- data/lib/rspec/expectations/extensions/object.rb +2 -12
- data/lib/rspec/expectations/fail_with.rb +11 -1
- data/lib/rspec/expectations/handler.rb +16 -7
- data/lib/rspec/expectations/syntax.rb +5 -7
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/expectations.rb +28 -2
- data/lib/rspec/matchers/be_close.rb +4 -1
- data/lib/rspec/matchers/built_in/base_matcher.rb +17 -10
- data/lib/rspec/matchers/built_in/be.rb +69 -32
- data/lib/rspec/matchers/built_in/be_within.rb +9 -3
- data/lib/rspec/matchers/built_in/change.rb +49 -3
- data/lib/rspec/matchers/built_in/has.rb +40 -7
- data/lib/rspec/matchers/built_in/have.rb +170 -5
- data/lib/rspec/matchers/built_in/include.rb +3 -11
- data/lib/rspec/matchers/built_in/match.rb +5 -0
- data/lib/rspec/matchers/built_in/match_array.rb +1 -1
- data/lib/rspec/matchers/built_in/raise_error.rb +34 -8
- data/lib/rspec/matchers/built_in/respond_to.rb +7 -1
- data/lib/rspec/matchers/built_in/satisfy.rb +7 -1
- data/lib/rspec/matchers/built_in/throw_symbol.rb +10 -2
- data/lib/rspec/matchers/built_in/yield.rb +102 -5
- data/lib/rspec/matchers/built_in.rb +2 -2
- data/lib/rspec/matchers/differentiate_block_method_types.rb +55 -0
- data/lib/rspec/matchers/dsl.rb +2 -1
- data/lib/rspec/matchers/match_aliases.rb +22 -0
- data/lib/rspec/matchers/matcher.rb +131 -10
- data/lib/rspec/matchers/operator_matcher.rb +70 -66
- data/lib/rspec/matchers/pretty.rb +11 -1
- data/lib/rspec/matchers/test_unit_integration.rb +28 -0
- data/lib/rspec/matchers.rb +175 -146
- data/lib/rspec-expectations.rb +5 -0
- data/spec/rspec/{matchers → expectations}/configuration_spec.rb +78 -91
- data/spec/rspec/expectations/differ_spec.rb +65 -6
- data/spec/rspec/expectations/expectation_target_spec.rb +72 -3
- data/spec/rspec/expectations/extensions/kernel_spec.rb +9 -5
- data/spec/rspec/expectations/fail_with_spec.rb +19 -0
- data/spec/rspec/expectations/handler_spec.rb +43 -22
- data/spec/rspec/expectations/syntax_spec.rb +51 -9
- data/spec/rspec/expectations_spec.rb +71 -0
- data/spec/rspec/matchers/base_matcher_spec.rb +33 -18
- data/spec/rspec/matchers/be_close_spec.rb +9 -6
- data/spec/rspec/matchers/be_spec.rb +146 -45
- data/spec/rspec/matchers/be_within_spec.rb +8 -0
- data/spec/rspec/matchers/change_spec.rb +107 -7
- data/spec/rspec/matchers/description_generation_spec.rb +38 -20
- data/spec/rspec/matchers/differentiate_block_method_types_spec.rb +39 -0
- data/spec/rspec/matchers/eq_spec.rb +1 -1
- data/spec/rspec/matchers/equal_spec.rb +26 -0
- data/spec/rspec/matchers/exist_spec.rb +9 -9
- data/spec/rspec/matchers/has_spec.rb +25 -1
- data/spec/rspec/matchers/have_spec.rb +411 -3
- data/spec/rspec/matchers/include_matcher_integration_spec.rb +2 -2
- data/spec/rspec/matchers/include_spec.rb +4 -4
- data/spec/rspec/matchers/match_array_spec.rb +1 -1
- data/spec/rspec/matchers/match_spec.rb +14 -1
- data/spec/rspec/matchers/matcher_spec.rb +213 -24
- data/spec/rspec/matchers/operator_matcher_spec.rb +56 -8
- data/spec/rspec/matchers/pretty_spec.rb +23 -0
- data/spec/rspec/matchers/raise_error_spec.rb +242 -102
- data/spec/rspec/matchers/respond_to_spec.rb +4 -4
- data/spec/rspec/matchers/satisfy_spec.rb +1 -1
- data/spec/rspec/matchers/start_with_end_with_spec.rb +2 -2
- data/spec/rspec/matchers/throw_symbol_spec.rb +14 -14
- data/spec/rspec/matchers/yield_spec.rb +81 -4
- data/spec/spec_helper.rb +5 -3
- data/spec/support/helper_methods.rb +42 -0
- data/spec/support/shared_examples.rb +42 -0
- metadata +40 -44
- data/spec/rspec/matchers/matchers_spec.rb +0 -37
|
@@ -63,10 +63,87 @@ describe "yield_control matcher" do
|
|
|
63
63
|
}.to fail_with(/expected given block to yield control/)
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
expect {
|
|
69
|
-
|
|
66
|
+
context "with exact count" do
|
|
67
|
+
it 'fails if the block yields wrong number of times' do
|
|
68
|
+
expect {
|
|
69
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.twice
|
|
70
|
+
}.to fail_with(/expected given block to yield control twice/)
|
|
71
|
+
|
|
72
|
+
expect {
|
|
73
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.exactly(3).times
|
|
74
|
+
}.to fail_with(/expected given block to yield control 3 times/)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
it 'passes if the block yields the specified number of times' do
|
|
78
|
+
expect { |b| [1].each(&b) }.to yield_control.once
|
|
79
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.twice
|
|
80
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.exactly(3).times
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
context "with at_least count" do
|
|
85
|
+
it 'passes if the block yields the given number of times' do
|
|
86
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_least(2).times
|
|
87
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_least(3).times
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
it 'passes if the block yields more times' do
|
|
91
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_least(2).times
|
|
92
|
+
expect { |b| [1, 2, 3, 4].each(&b) }.to yield_control.at_least(3).times
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
it 'allows :once and :twice to be passed as counts' do
|
|
96
|
+
expect { |b| [1].each(&b) }.to yield_control.at_least(:once)
|
|
97
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_least(:once)
|
|
98
|
+
|
|
99
|
+
expect {
|
|
100
|
+
expect { |b| [].each(&b) }.to yield_control.at_least(:once)
|
|
101
|
+
}.to fail_with(/at least once/)
|
|
102
|
+
|
|
103
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_least(:twice)
|
|
104
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_least(:twice)
|
|
105
|
+
|
|
106
|
+
expect {
|
|
107
|
+
expect { |b| [1].each(&b) }.to yield_control.at_least(:twice)
|
|
108
|
+
}.to fail_with(/at least twice/)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
it 'fails if the block yields too few times' do
|
|
112
|
+
expect {
|
|
113
|
+
expect { |b| _yield_with_no_args(&b) }.to yield_control.at_least(2).times
|
|
114
|
+
}.to fail_with(/expected given block to yield control at least twice/)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
context "with at_most count" do
|
|
119
|
+
it 'passes if the block yields the given number of times' do
|
|
120
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_most(2).times
|
|
121
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_most(3).times
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
it 'passes if the block yields fewer times' do
|
|
125
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_most(3).times
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
it 'allows :once and :twice to be passed as counts' do
|
|
129
|
+
expect { |b| [1].each(&b) }.to yield_control.at_most(:once)
|
|
130
|
+
|
|
131
|
+
expect {
|
|
132
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_most(:once)
|
|
133
|
+
}.to fail_with(/expected given block to yield control at most once/)
|
|
134
|
+
|
|
135
|
+
expect { |b| [1, 2].each(&b) }.to yield_control.at_most(:twice)
|
|
136
|
+
|
|
137
|
+
expect {
|
|
138
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_most(:twice)
|
|
139
|
+
}.to fail_with(/expected given block to yield control at most twice/)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it 'fails if the block yields too many times' do
|
|
143
|
+
expect {
|
|
144
|
+
expect { |b| [1, 2, 3].each(&b) }.to yield_control.at_most(2).times
|
|
145
|
+
}.to fail_with(/expected given block to yield control at most twice/)
|
|
146
|
+
end
|
|
70
147
|
end
|
|
71
148
|
end
|
|
72
149
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -2,8 +2,8 @@ Dir['./spec/support/**/*'].each {|f| require f}
|
|
|
2
2
|
|
|
3
3
|
RSpec::configure do |config|
|
|
4
4
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
|
5
|
-
config.
|
|
6
|
-
config.filter_run :
|
|
5
|
+
config.color = true
|
|
6
|
+
config.filter_run :focus
|
|
7
7
|
config.run_all_when_everything_filtered = true
|
|
8
8
|
config.order = :random
|
|
9
9
|
|
|
@@ -11,6 +11,8 @@ RSpec::configure do |config|
|
|
|
11
11
|
$default_expectation_syntax = expectations.syntax
|
|
12
12
|
expectations.syntax = :expect
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
config.include DeprecationHelpers
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
shared_context "with #should enabled", :uses_should do
|
|
@@ -46,7 +48,7 @@ module TestUnitIntegrationSupport
|
|
|
46
48
|
def with_test_unit_loaded
|
|
47
49
|
in_sub_process do
|
|
48
50
|
require 'test/unit'
|
|
49
|
-
load 'rspec/matchers.rb'
|
|
51
|
+
load 'rspec/matchers/test_unit_integration.rb'
|
|
50
52
|
yield
|
|
51
53
|
end
|
|
52
54
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module DeprecationHelpers
|
|
2
|
+
|
|
3
|
+
def expect_deprecation_with_call_site(file, line, snippet = //)
|
|
4
|
+
expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
|
|
5
|
+
matcher = include([file, line].join(':'))
|
|
6
|
+
call_site = options[:call_site] || options[:message]
|
|
7
|
+
|
|
8
|
+
unless matcher.matches?(call_site)
|
|
9
|
+
# RSpec::Expectations::ExpectationNotMetError is rescued in the `match` block
|
|
10
|
+
# of a custom matcher and returned as `false` from `matches?`. This would
|
|
11
|
+
# prevent an expectation failure here from surfacing in the test suite if
|
|
12
|
+
# it's triggered from within a `match` block, so we need to raise
|
|
13
|
+
# a different error class instead.
|
|
14
|
+
raise matcher.failure_message_for_should
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
deprecated = options[:deprecated] || options[:message]
|
|
18
|
+
expect(deprecated).to match(snippet)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def expect_deprecation_with_type(expression, message, type)
|
|
23
|
+
expect(RSpec).to receive(:deprecate).with(expression,
|
|
24
|
+
:replacement => message,
|
|
25
|
+
:type => type
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def expect_deprecation_with_replacement(snippet)
|
|
30
|
+
expect(RSpec).to receive(:deprecate) do |_, options|
|
|
31
|
+
expect(options[:replacement]).to match(snippet)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def allow_deprecation
|
|
36
|
+
allow(RSpec.configuration.reporter).to receive(:deprecation)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def expect_no_deprecation
|
|
40
|
+
expect(RSpec.configuration.reporter).not_to receive(:deprecation)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -1,13 +1,55 @@
|
|
|
1
1
|
shared_examples_for "an RSpec matcher" do |options|
|
|
2
2
|
let(:valid_value) { options.fetch(:valid_value) }
|
|
3
3
|
let(:invalid_value) { options.fetch(:invalid_value) }
|
|
4
|
+
let(:deprecations) { [] }
|
|
5
|
+
|
|
6
|
+
def matched_deprecations
|
|
7
|
+
deprecations.select { |opts| opts[:deprecated] =~ /matcher == value/ }
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
before do
|
|
11
|
+
allow(RSpec.configuration.reporter).to receive(:deprecation) do |opts|
|
|
12
|
+
deprecations << opts
|
|
13
|
+
end
|
|
14
|
+
end
|
|
4
15
|
|
|
5
16
|
it 'matches a valid value when using #== so it can be composed' do
|
|
6
17
|
expect(matcher).to eq(valid_value)
|
|
7
18
|
end
|
|
8
19
|
|
|
20
|
+
it 'matches a valid value when using #=== so it can be composed' do
|
|
21
|
+
expect(matcher).to be === valid_value
|
|
22
|
+
end
|
|
23
|
+
|
|
9
24
|
it 'does not match an invalid value when using #== so it can be composed' do
|
|
10
25
|
expect(matcher).not_to eq(invalid_value)
|
|
11
26
|
end
|
|
27
|
+
|
|
28
|
+
it 'does not match an invalid value when using #=== so it can be composed' do
|
|
29
|
+
expect(matcher).not_to be === invalid_value
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'does not print a deprecation warning when using #===' do
|
|
33
|
+
matcher === valid_value
|
|
34
|
+
matcher === invalid_value
|
|
35
|
+
expect(matched_deprecations).to eq([])
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it 'does not print a deprecation warning when using #== if it returns false' do
|
|
39
|
+
(matcher == invalid_value).nil? # calling a method to avoid a warning
|
|
40
|
+
expect(matched_deprecations).to eq([])
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'does not print a deprecation warning when using #== if it returns true because it was given the same object' do
|
|
44
|
+
expect(matcher).to be == matcher
|
|
45
|
+
expect(matched_deprecations).to eq([])
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'prints a deprecation warning for #== when given a valid value since' do
|
|
49
|
+
(matcher == valid_value).nil? # calling a method to avoid a warning
|
|
50
|
+
expect(matched_deprecations.count).to eq(1)
|
|
51
|
+
deprecation = matched_deprecations.first
|
|
52
|
+
expect(deprecation[:call_site]).to include([__FILE__, __LINE__ - 3].join(':'))
|
|
53
|
+
end
|
|
12
54
|
end
|
|
13
55
|
|
metadata
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
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: 2.99.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Steven Baker
|
|
@@ -10,10 +9,11 @@ authors:
|
|
|
10
9
|
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 2014-06-01 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
|
-
|
|
15
|
+
name: diff-lcs
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
18
|
- - ! '>='
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
@@ -21,10 +21,9 @@ dependencies:
|
|
|
21
21
|
- - <
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
23
|
version: '2.0'
|
|
24
|
-
|
|
24
|
+
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
|
-
|
|
27
|
-
requirement: !ruby/object:Gem::Requirement
|
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
28
27
|
requirements:
|
|
29
28
|
- - ! '>='
|
|
30
29
|
- !ruby/object:Gem::Version
|
|
@@ -32,56 +31,48 @@ dependencies:
|
|
|
32
31
|
- - <
|
|
33
32
|
- !ruby/object:Gem::Version
|
|
34
33
|
version: '2.0'
|
|
35
|
-
none: false
|
|
36
|
-
type: :runtime
|
|
37
34
|
- !ruby/object:Gem::Dependency
|
|
38
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
-
requirements:
|
|
40
|
-
- - ~>
|
|
41
|
-
- !ruby/object:Gem::Version
|
|
42
|
-
version: 10.0.0
|
|
43
|
-
none: false
|
|
44
|
-
prerelease: false
|
|
45
35
|
name: rake
|
|
46
36
|
requirement: !ruby/object:Gem::Requirement
|
|
47
37
|
requirements:
|
|
48
38
|
- - ~>
|
|
49
39
|
- !ruby/object:Gem::Version
|
|
50
40
|
version: 10.0.0
|
|
51
|
-
none: false
|
|
52
41
|
type: :development
|
|
53
|
-
|
|
42
|
+
prerelease: false
|
|
54
43
|
version_requirements: !ruby/object:Gem::Requirement
|
|
55
44
|
requirements:
|
|
56
45
|
- - ~>
|
|
57
46
|
- !ruby/object:Gem::Version
|
|
58
|
-
version:
|
|
59
|
-
|
|
60
|
-
prerelease: false
|
|
47
|
+
version: 10.0.0
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
61
49
|
name: cucumber
|
|
62
50
|
requirement: !ruby/object:Gem::Requirement
|
|
63
51
|
requirements:
|
|
64
52
|
- - ~>
|
|
65
53
|
- !ruby/object:Gem::Version
|
|
66
54
|
version: 1.1.9
|
|
67
|
-
none: false
|
|
68
55
|
type: :development
|
|
69
|
-
|
|
56
|
+
prerelease: false
|
|
70
57
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
58
|
requirements:
|
|
72
59
|
- - ~>
|
|
73
60
|
- !ruby/object:Gem::Version
|
|
74
|
-
version:
|
|
75
|
-
|
|
76
|
-
prerelease: false
|
|
61
|
+
version: 1.1.9
|
|
62
|
+
- !ruby/object:Gem::Dependency
|
|
77
63
|
name: aruba
|
|
78
64
|
requirement: !ruby/object:Gem::Requirement
|
|
79
65
|
requirements:
|
|
80
66
|
- - ~>
|
|
81
67
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 0.
|
|
83
|
-
none: false
|
|
68
|
+
version: '0.5'
|
|
84
69
|
type: :development
|
|
70
|
+
prerelease: false
|
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ~>
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0.5'
|
|
85
76
|
description: rspec expectations (should[_not] and matchers)
|
|
86
77
|
email: rspec-users@rubyforge.org
|
|
87
78
|
executables: []
|
|
@@ -90,6 +81,8 @@ extra_rdoc_files: []
|
|
|
90
81
|
files:
|
|
91
82
|
- lib/rspec-expectations.rb
|
|
92
83
|
- lib/rspec/expectations.rb
|
|
84
|
+
- lib/rspec/expectations/caller_filter.rb
|
|
85
|
+
- lib/rspec/expectations/configuration.rb
|
|
93
86
|
- lib/rspec/expectations/deprecation.rb
|
|
94
87
|
- lib/rspec/expectations/differ.rb
|
|
95
88
|
- lib/rspec/expectations/errors.rb
|
|
@@ -127,14 +120,16 @@ files:
|
|
|
127
120
|
- lib/rspec/matchers/built_in/throw_symbol.rb
|
|
128
121
|
- lib/rspec/matchers/built_in/yield.rb
|
|
129
122
|
- lib/rspec/matchers/compatibility.rb
|
|
130
|
-
- lib/rspec/matchers/
|
|
123
|
+
- lib/rspec/matchers/differentiate_block_method_types.rb
|
|
131
124
|
- lib/rspec/matchers/dsl.rb
|
|
132
125
|
- lib/rspec/matchers/extensions/instance_eval_with_args.rb
|
|
133
126
|
- lib/rspec/matchers/generated_descriptions.rb
|
|
127
|
+
- lib/rspec/matchers/match_aliases.rb
|
|
134
128
|
- lib/rspec/matchers/matcher.rb
|
|
135
129
|
- lib/rspec/matchers/method_missing.rb
|
|
136
130
|
- lib/rspec/matchers/operator_matcher.rb
|
|
137
131
|
- lib/rspec/matchers/pretty.rb
|
|
132
|
+
- lib/rspec/matchers/test_unit_integration.rb
|
|
138
133
|
- README.md
|
|
139
134
|
- License.txt
|
|
140
135
|
- Changelog.md
|
|
@@ -172,14 +167,17 @@ files:
|
|
|
172
167
|
- features/implicit_docstrings.feature
|
|
173
168
|
- features/step_definitions/additional_cli_steps.rb
|
|
174
169
|
- features/support/env.rb
|
|
170
|
+
- features/support/rubinius.rb
|
|
175
171
|
- features/syntax_configuration.feature
|
|
176
172
|
- features/test_frameworks/test_unit.feature
|
|
173
|
+
- spec/rspec/expectations/configuration_spec.rb
|
|
177
174
|
- spec/rspec/expectations/differ_spec.rb
|
|
178
175
|
- spec/rspec/expectations/expectation_target_spec.rb
|
|
179
176
|
- spec/rspec/expectations/extensions/kernel_spec.rb
|
|
180
177
|
- spec/rspec/expectations/fail_with_spec.rb
|
|
181
178
|
- spec/rspec/expectations/handler_spec.rb
|
|
182
179
|
- spec/rspec/expectations/syntax_spec.rb
|
|
180
|
+
- spec/rspec/expectations_spec.rb
|
|
183
181
|
- spec/rspec/matchers/base_matcher_spec.rb
|
|
184
182
|
- spec/rspec/matchers/be_close_spec.rb
|
|
185
183
|
- spec/rspec/matchers/be_instance_of_spec.rb
|
|
@@ -187,9 +185,9 @@ files:
|
|
|
187
185
|
- spec/rspec/matchers/be_spec.rb
|
|
188
186
|
- spec/rspec/matchers/be_within_spec.rb
|
|
189
187
|
- spec/rspec/matchers/change_spec.rb
|
|
190
|
-
- spec/rspec/matchers/configuration_spec.rb
|
|
191
188
|
- spec/rspec/matchers/cover_spec.rb
|
|
192
189
|
- spec/rspec/matchers/description_generation_spec.rb
|
|
190
|
+
- spec/rspec/matchers/differentiate_block_method_types_spec.rb
|
|
193
191
|
- spec/rspec/matchers/dsl_spec.rb
|
|
194
192
|
- spec/rspec/matchers/eq_spec.rb
|
|
195
193
|
- spec/rspec/matchers/eql_spec.rb
|
|
@@ -202,9 +200,9 @@ files:
|
|
|
202
200
|
- spec/rspec/matchers/match_array_spec.rb
|
|
203
201
|
- spec/rspec/matchers/match_spec.rb
|
|
204
202
|
- spec/rspec/matchers/matcher_spec.rb
|
|
205
|
-
- spec/rspec/matchers/matchers_spec.rb
|
|
206
203
|
- spec/rspec/matchers/method_missing_spec.rb
|
|
207
204
|
- spec/rspec/matchers/operator_matcher_spec.rb
|
|
205
|
+
- spec/rspec/matchers/pretty_spec.rb
|
|
208
206
|
- spec/rspec/matchers/raise_error_spec.rb
|
|
209
207
|
- spec/rspec/matchers/respond_to_spec.rb
|
|
210
208
|
- spec/rspec/matchers/satisfy_spec.rb
|
|
@@ -213,6 +211,7 @@ files:
|
|
|
213
211
|
- spec/rspec/matchers/yield_spec.rb
|
|
214
212
|
- spec/spec_helper.rb
|
|
215
213
|
- spec/support/classes.rb
|
|
214
|
+
- spec/support/helper_methods.rb
|
|
216
215
|
- spec/support/in_sub_process.rb
|
|
217
216
|
- spec/support/matchers.rb
|
|
218
217
|
- spec/support/ruby_version.rb
|
|
@@ -220,6 +219,7 @@ files:
|
|
|
220
219
|
homepage: http://github.com/rspec/rspec-expectations
|
|
221
220
|
licenses:
|
|
222
221
|
- MIT
|
|
222
|
+
metadata: {}
|
|
223
223
|
post_install_message:
|
|
224
224
|
rdoc_options:
|
|
225
225
|
- --charset=UTF-8
|
|
@@ -230,25 +230,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
230
230
|
- - ! '>='
|
|
231
231
|
- !ruby/object:Gem::Version
|
|
232
232
|
version: '0'
|
|
233
|
-
segments:
|
|
234
|
-
- 0
|
|
235
|
-
hash: 3249637945894736858
|
|
236
|
-
none: false
|
|
237
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
238
234
|
requirements:
|
|
239
235
|
- - ! '>='
|
|
240
236
|
- !ruby/object:Gem::Version
|
|
241
237
|
version: '0'
|
|
242
|
-
segments:
|
|
243
|
-
- 0
|
|
244
|
-
hash: 3249637945894736858
|
|
245
|
-
none: false
|
|
246
238
|
requirements: []
|
|
247
239
|
rubyforge_project: rspec
|
|
248
|
-
rubygems_version:
|
|
240
|
+
rubygems_version: 2.0.7
|
|
249
241
|
signing_key:
|
|
250
|
-
specification_version:
|
|
251
|
-
summary: rspec-expectations-2.
|
|
242
|
+
specification_version: 4
|
|
243
|
+
summary: rspec-expectations-2.99.0
|
|
252
244
|
test_files:
|
|
253
245
|
- features/README.md
|
|
254
246
|
- features/Upgrade.md
|
|
@@ -282,14 +274,17 @@ test_files:
|
|
|
282
274
|
- features/implicit_docstrings.feature
|
|
283
275
|
- features/step_definitions/additional_cli_steps.rb
|
|
284
276
|
- features/support/env.rb
|
|
277
|
+
- features/support/rubinius.rb
|
|
285
278
|
- features/syntax_configuration.feature
|
|
286
279
|
- features/test_frameworks/test_unit.feature
|
|
280
|
+
- spec/rspec/expectations/configuration_spec.rb
|
|
287
281
|
- spec/rspec/expectations/differ_spec.rb
|
|
288
282
|
- spec/rspec/expectations/expectation_target_spec.rb
|
|
289
283
|
- spec/rspec/expectations/extensions/kernel_spec.rb
|
|
290
284
|
- spec/rspec/expectations/fail_with_spec.rb
|
|
291
285
|
- spec/rspec/expectations/handler_spec.rb
|
|
292
286
|
- spec/rspec/expectations/syntax_spec.rb
|
|
287
|
+
- spec/rspec/expectations_spec.rb
|
|
293
288
|
- spec/rspec/matchers/base_matcher_spec.rb
|
|
294
289
|
- spec/rspec/matchers/be_close_spec.rb
|
|
295
290
|
- spec/rspec/matchers/be_instance_of_spec.rb
|
|
@@ -297,9 +292,9 @@ test_files:
|
|
|
297
292
|
- spec/rspec/matchers/be_spec.rb
|
|
298
293
|
- spec/rspec/matchers/be_within_spec.rb
|
|
299
294
|
- spec/rspec/matchers/change_spec.rb
|
|
300
|
-
- spec/rspec/matchers/configuration_spec.rb
|
|
301
295
|
- spec/rspec/matchers/cover_spec.rb
|
|
302
296
|
- spec/rspec/matchers/description_generation_spec.rb
|
|
297
|
+
- spec/rspec/matchers/differentiate_block_method_types_spec.rb
|
|
303
298
|
- spec/rspec/matchers/dsl_spec.rb
|
|
304
299
|
- spec/rspec/matchers/eq_spec.rb
|
|
305
300
|
- spec/rspec/matchers/eql_spec.rb
|
|
@@ -312,9 +307,9 @@ test_files:
|
|
|
312
307
|
- spec/rspec/matchers/match_array_spec.rb
|
|
313
308
|
- spec/rspec/matchers/match_spec.rb
|
|
314
309
|
- spec/rspec/matchers/matcher_spec.rb
|
|
315
|
-
- spec/rspec/matchers/matchers_spec.rb
|
|
316
310
|
- spec/rspec/matchers/method_missing_spec.rb
|
|
317
311
|
- spec/rspec/matchers/operator_matcher_spec.rb
|
|
312
|
+
- spec/rspec/matchers/pretty_spec.rb
|
|
318
313
|
- spec/rspec/matchers/raise_error_spec.rb
|
|
319
314
|
- spec/rspec/matchers/respond_to_spec.rb
|
|
320
315
|
- spec/rspec/matchers/satisfy_spec.rb
|
|
@@ -323,6 +318,7 @@ test_files:
|
|
|
323
318
|
- spec/rspec/matchers/yield_spec.rb
|
|
324
319
|
- spec/spec_helper.rb
|
|
325
320
|
- spec/support/classes.rb
|
|
321
|
+
- spec/support/helper_methods.rb
|
|
326
322
|
- spec/support/in_sub_process.rb
|
|
327
323
|
- spec/support/matchers.rb
|
|
328
324
|
- spec/support/ruby_version.rb
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
module RSpec
|
|
4
|
-
describe Matchers do
|
|
5
|
-
|
|
6
|
-
let(:sample_matchers) do
|
|
7
|
-
[:be,
|
|
8
|
-
:be_close,
|
|
9
|
-
:be_instance_of,
|
|
10
|
-
:be_kind_of]
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
context "once required" do
|
|
14
|
-
include TestUnitIntegrationSupport
|
|
15
|
-
|
|
16
|
-
it "includes itself in Test::Unit::TestCase" do
|
|
17
|
-
with_test_unit_loaded do
|
|
18
|
-
test_unit_case = Test::Unit::TestCase.allocate
|
|
19
|
-
sample_matchers.each do |sample_matcher|
|
|
20
|
-
expect(test_unit_case).to respond_to(sample_matcher)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "includes itself in MiniTest::Unit::TestCase", :if => defined?(MiniTest) do
|
|
26
|
-
with_test_unit_loaded do
|
|
27
|
-
minitest_case = MiniTest::Unit::TestCase.allocate
|
|
28
|
-
sample_matchers.each do |sample_matcher|
|
|
29
|
-
expect(minitest_case).to respond_to(sample_matcher)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
end
|
|
37
|
-
end
|