remove patch
This commit is contained in:
parent
95b471521a
commit
e056b268aa
@ -1,73 +0,0 @@
|
||||
diff --git a/spec/rspec/support/fuzzy_matcher_spec.rb b/spec/rspec/support/fuzzy_matcher_spec.rb
|
||||
index fc92ec5..2c0abec 100644
|
||||
--- a/spec/rspec/support/fuzzy_matcher_spec.rb
|
||||
+++ b/spec/rspec/support/fuzzy_matcher_spec.rb
|
||||
@@ -120,17 +120,17 @@ module RSpec
|
||||
end
|
||||
|
||||
it 'does the fuzzy matching on the individual elements' do
|
||||
- expect([String, Fixnum]).to match_against(["a", 2])
|
||||
- expect([String, Fixnum]).not_to match_against([2, "a"])
|
||||
+ expect([String, Integer]).to match_against(["a", 2])
|
||||
+ expect([String, Integer]).not_to match_against([2, "a"])
|
||||
end
|
||||
|
||||
it 'returns false if they have a different number of elements' do
|
||||
- expect([String, Fixnum]).not_to match_against(['a', 2, nil])
|
||||
+ expect([String, Integer]).not_to match_against(['a', 2, nil])
|
||||
end
|
||||
|
||||
it 'supports arbitrary nested arrays' do
|
||||
a1 = [
|
||||
- [String, Fixnum, [be_within(0.1).of(2)]],
|
||||
+ [String, Integer, [be_within(0.1).of(2)]],
|
||||
3, [[[ /foo/ ]]]
|
||||
]
|
||||
|
||||
@@ -154,8 +154,8 @@ module RSpec
|
||||
end
|
||||
end.new
|
||||
|
||||
- expect([Fixnum, String]).to match_against(my_enum)
|
||||
- expect([String, Fixnum]).not_to match_against(my_enum)
|
||||
+ expect([Integer, String]).to match_against(my_enum)
|
||||
+ expect([String, Integer]).not_to match_against(my_enum)
|
||||
end
|
||||
|
||||
it 'does not match an empty hash against an empty array or vice-versa' do
|
||||
@@ -192,7 +192,7 @@ module RSpec
|
||||
it 'supports arbitrary nested hashes' do
|
||||
h1 = {
|
||||
:a => {
|
||||
- :b => [String, Fixnum],
|
||||
+ :b => [String, Integer],
|
||||
:c => { :d => be_within(0.1).of(2) }
|
||||
}
|
||||
}
|
||||
diff --git a/spec/rspec/support/object_formatter_spec.rb b/spec/rspec/support/object_formatter_spec.rb
|
||||
index 7e16fb5..6eed58c 100644
|
||||
--- a/spec/rspec/support/object_formatter_spec.rb
|
||||
+++ b/spec/rspec/support/object_formatter_spec.rb
|
||||
@@ -82,10 +82,19 @@ module RSpec
|
||||
|
||||
let(:formatted_decimal) { ObjectFormatter.format(decimal) }
|
||||
|
||||
- it 'fails with a conventional representation of the decimal' do
|
||||
- in_sub_process_if_possible do
|
||||
- require 'bigdecimal'
|
||||
- expect(formatted_decimal).to include('3.3 (#<BigDecimal')
|
||||
+ if RUBY_VERSION >= '2.4'
|
||||
+ it "uses Ruby's BigDecimal formatting since it is improved in 2.4+" do
|
||||
+ in_sub_process_if_possible do
|
||||
+ require 'bigdecimal'
|
||||
+ expect(formatted_decimal).to eq('0.33e1')
|
||||
+ end
|
||||
+ end
|
||||
+ else
|
||||
+ it 'includes a conventional representation of the decimal' do
|
||||
+ in_sub_process_if_possible do
|
||||
+ require 'bigdecimal'
|
||||
+ expect(formatted_decimal).to include('3.3 (#<BigDecimal')
|
||||
+ end
|
||||
end
|
||||
end
|
@ -1,18 +0,0 @@
|
||||
diff --git a/lib/rspec/support/object_formatter.rb b/lib/rspec/support/object_formatter.rb
|
||||
index 6f74061..6c83209 100644
|
||||
--- a/lib/rspec/support/object_formatter.rb
|
||||
+++ b/lib/rspec/support/object_formatter.rb
|
||||
@@ -243,7 +243,12 @@ module RSpec
|
||||
DescribableMatcherInspector,
|
||||
DelegatorInspector,
|
||||
InspectableObjectInspector
|
||||
- ]
|
||||
+ ].tap do |classes|
|
||||
+ # 2.4 has improved BigDecimal formatting so we do not need
|
||||
+ # to provide our own.
|
||||
+ # https://github.com/ruby/bigdecimal/pull/42
|
||||
+ classes.delete(BigDecimalInspector) if RUBY_VERSION >= '2.4'
|
||||
+ end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user