commit rubygem-rspec-expectations for openSUSE:Factory
Hello community, here is the log from the commit of package rubygem-rspec-expectations for openSUSE:Factory checked in at 2019-12-28 13:39:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-expectations (Old) and /work/SRC/openSUSE:Factory/.rubygem-rspec-expectations.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "rubygem-rspec-expectations" Sat Dec 28 13:39:57 2019 rev:18 rq:747731 version:3.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rspec-expectations/rubygem-rspec-expectations.changes 2019-07-22 12:16:19.447729202 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-rspec-expectations.new.6675/rubygem-rspec-expectations.changes 2019-12-28 13:39:59.718917136 +0100 @@ -1,0 +2,18 @@ +Tue Nov 12 14:36:18 UTC 2019 - Manuel Schnitzer <mschnitzer@suse.com> + +- updated to version 3.9.0 + + [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.6...v3.9.0) + + Enhancements: + + * The `respond_to` matcher now uses the signature from `initialize` to validate checks + for `new` (unless `new` is non standard). (Jon Rowe, #1072) + * Generated descriptions for matchers now use `is expected to` rather than `should` in + line with our preferred DSL. (Pete Johns, #1080, rspec/rspec-core#2572) + * Add the ability to re-raise expectation errors when matching + with `match_when_negated` blocks. (Jon Rowe, #1130) + * Add a warning when an empty diff is produce due to identical inspect output. + (Benoit Tigeot, #1126) + +------------------------------------------------------------------- Old: ---- rspec-expectations-3.8.4.gem New: ---- rspec-expectations-3.9.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rspec-expectations.spec ++++++ --- /var/tmp/diff_new_pack.78dgsz/_old 2019-12-28 13:40:01.590918081 +0100 +++ /var/tmp/diff_new_pack.78dgsz/_new 2019-12-28 13:40:01.634918103 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-rspec-expectations -Version: 3.8.4 +Version: 3.9.0 Release: 0 %define mod_name rspec-expectations %define mod_full_name %{mod_name}-%{version} ++++++ rspec-expectations-3.8.4.gem -> rspec-expectations-3.9.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Changelog.md new/Changelog.md --- old/Changelog.md 2019-06-10 22:14:19.000000000 +0200 +++ new/Changelog.md 2019-10-07 23:35:25.000000000 +0200 @@ -1,3 +1,32 @@ +### 3.9.0 / 2019-10-02 +[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.5...v3.9.0) + +Enhancements: + +* The `respond_to` matcher now uses the signature from `initialize` to validate checks + for `new` (unless `new` is non standard). (Jon Rowe, #1072) +* Generated descriptions for matchers now use `is expected to` rather than `should` in + line with our preferred DSL. (Pete Johns, #1080, rspec/rspec-core#2572) +* Add the ability to re-raise expectation errors when matching + with `match_when_negated` blocks. (Jon Rowe, #1130) +* Add a warning when an empty diff is produce due to identical inspect output. + (Benoit Tigeot, #1126) + +### 3.8.6 / 2019-10-07 + +Bug Fixes: + +* Revert #1125 due to the change being incompatible with our semantic versioning + policy. + +### 3.8.5 / 2019-10-02 +[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.4...v3.8.5) + +Bug Fixes: + +* Prevent unsupported implicit block expectation syntax from being used. + (Phil Pirozhkov, #1125) + ### 3.8.4 / 2019-06-10 [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.8.3...v3.8.4) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2019-06-10 22:14:19.000000000 +0200 +++ new/README.md 2019-10-07 23:35:25.000000000 +0200 @@ -175,30 +175,45 @@ ### Collection membership ```ruby -expect(actual).to include(expected) +# exact order, entire collection +expect(actual).to eq(expected) + +# exact order, partial collection (based on an exact position) expect(actual).to start_with(expected) expect(actual).to end_with(expected) -expect(actual).to contain_exactly(individual, items) -# ...which is the same as: -expect(actual).to match_array(expected_array) +# any order, entire collection +expect(actual).to match_array(expected) + +# You can also express this by passing the expected elements +# as individual arguments +expect(actual).to contain_exactly(expected_element1, expected_element2) + + # any order, partial collection +expect(actual).to include(expected) ``` #### Examples ```ruby -expect([1, 2, 3]).to include(1) -expect([1, 2, 3]).to include(1, 2) -expect([1, 2, 3]).to start_with(1) -expect([1, 2, 3]).to start_with(1, 2) -expect([1, 2, 3]).to end_with(3) -expect([1, 2, 3]).to end_with(2, 3) -expect({:a => 'b'}).to include(:a => 'b') -expect("this string").to include("is str") -expect("this string").to start_with("this") -expect("this string").to end_with("ring") -expect([1, 2, 3]).to contain_exactly(2, 3, 1) -expect([1, 2, 3]).to match_array([3, 2, 1]) +expect([1, 2, 3]).to eq([1, 2, 3]) # Order dependent equality check +expect([1, 2, 3]).to include(1) # Exact ordering, partial collection matches +expect([1, 2, 3]).to include(2, 3) # +expect([1, 2, 3]).to start_with(1) # As above, but from the start of the collection +expect([1, 2, 3]).to start_with(1, 2) # +expect([1, 2, 3]).to end_with(3) # As above but from the end of the collection +expect([1, 2, 3]).to end_with(2, 3) # +expect({:a => 'b'}).to include(:a => 'b') # Matching within hashes +expect("this string").to include("is str") # Matching within strings +expect("this string").to start_with("this") # +expect("this string").to end_with("ring") # +expect([1, 2, 3]).to contain_exactly(2, 3, 1) # Order independent matches +expect([1, 2, 3]).to match_array([3, 2, 1]) # + +# Order dependent compound matchers +expect( + [{:a => 'hash'},{:a => 'another'}] +).to match([a_hash_including(:a => 'hash'), a_hash_including(:a => 'another')]) ``` ## `should` syntax Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/expectations/handler.rb new/lib/rspec/expectations/handler.rb --- old/lib/rspec/expectations/handler.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/expectations/handler.rb 2019-10-07 23:35:25.000000000 +0200 @@ -52,7 +52,7 @@ end def self.verb - "should" + 'is expected to' end def self.should_method @@ -82,7 +82,7 @@ end def self.verb - "should not" + 'is expected not to' end def self.should_method diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/expectations/version.rb new/lib/rspec/expectations/version.rb --- old/lib/rspec/expectations/version.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/expectations/version.rb 2019-10-07 23:35:25.000000000 +0200 @@ -2,7 +2,7 @@ module Expectations # @private module Version - STRING = '3.8.4' + STRING = '3.9.0' end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/matchers/built_in/compound.rb new/lib/rspec/matchers/built_in/compound.rb --- old/lib/rspec/matchers/built_in/compound.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/matchers/built_in/compound.rb 2019-10-07 23:35:25.000000000 +0200 @@ -154,7 +154,12 @@ end def matcher_matches?(matcher) - @match_results.fetch(matcher) + @match_results.fetch(matcher) do + raise ArgumentError, "Your #{matcher.description} has no match " \ + "results, this can occur when an unexpected call stack or " \ + "local jump occurs. Prehaps one of your matchers needs to " \ + "declare `expects_call_stack_jump?` as `true`?" + end end private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/matchers/built_in/respond_to.rb new/lib/rspec/matchers/built_in/respond_to.rb --- old/lib/rspec/matchers/built_in/respond_to.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/matchers/built_in/respond_to.rb 2019-10-07 23:35:25.000000000 +0200 @@ -125,9 +125,18 @@ return true if expectation.empty? - signature = Support::MethodSignature.new(Support.method_handle_for(actual, name)) + Support::StrictSignatureVerifier.new(method_signature_for(actual, name)). + with_expectation(expectation).valid? + end + + def method_signature_for(actual, name) + method_handle = Support.method_handle_for(actual, name) - Support::StrictSignatureVerifier.new(signature).with_expectation(expectation).valid? + if name == :new && method_handle.owner === ::Class && ::Class === actual + Support::MethodSignature.new(actual.instance_method(:initialize)) + else + Support::MethodSignature.new(method_handle) + end end def with_arity diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/matchers/dsl.rb new/lib/rspec/matchers/dsl.rb --- old/lib/rspec/matchers/dsl.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/matchers/dsl.rb 2019-10-07 23:35:25.000000000 +0200 @@ -147,8 +147,14 @@ # is rarely necessary, but can be helpful, for example, when specifying # asynchronous processes that require different timeouts. # + # By default the match block will swallow expectation errors (e.g. + # caused by using an expectation such as `expect(1).to eq 2`), if you + # with to allow these to bubble up, pass in the option + # `:notify_expectation_failures => true`. + # + # @param [Hash] options for defining the behavior of the match block. # @yield [Object] actual the actual value (i.e. the value wrapped by `expect`) - def match_when_negated(&match_block) + def match_when_negated(options={}, &match_block) define_user_override(:does_not_match?, match_block) do |actual| begin @actual = actual @@ -156,6 +162,7 @@ super(*actual_arg_for(match_block)) end rescue RSpec::Expectations::ExpectationNotMetError + raise if options[:notify_expectation_failures] false end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/matchers/expecteds_for_multiple_diffs.rb new/lib/rspec/matchers/expecteds_for_multiple_diffs.rb --- old/lib/rspec/matchers/expecteds_for_multiple_diffs.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/matchers/expecteds_for_multiple_diffs.rb 2019-10-07 23:35:25.000000000 +0200 @@ -52,20 +52,29 @@ private - def self.diff_label_for(matcher) - "Diff for (#{truncated(RSpec::Support::ObjectFormatter.format(matcher))}):" - end + class << self + private + + def diff_label_for(matcher) + "Diff for (#{truncated(RSpec::Support::ObjectFormatter.format(matcher))}):" + end - def self.truncated(description) - return description if description.length <= DESCRIPTION_MAX_LENGTH - description[0...DESCRIPTION_MAX_LENGTH - 3] << "..." + def truncated(description) + return description if description.length <= DESCRIPTION_MAX_LENGTH + description[0...DESCRIPTION_MAX_LENGTH - 3] << "..." + end end def diffs(differ, actual) @expected_list.map do |(expected, diff_label)| diff = differ.diff(actual, expected) next if diff.strip.empty? - "#{diff_label}#{diff}" + if diff == "\e[0m\n\e[0m" + "#{diff_label}\n" \ + " <The diff is empty, are your objects producing identical `#inspect` output?>" + else + "#{diff_label}#{diff}" + end end.compact.join("\n") end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rspec/matchers.rb new/lib/rspec/matchers.rb --- old/lib/rspec/matchers.rb 2019-06-10 22:14:19.000000000 +0200 +++ new/lib/rspec/matchers.rb 2019-10-07 23:35:25.000000000 +0200 @@ -266,9 +266,9 @@ # @example # expect(actual).to eq(expected) # expect(actual).not_to eq(expected) - # @return [ExpectationTarget] - # @see ExpectationTarget#to - # @see ExpectationTarget#not_to + # @return [Expectations::ExpectationTarget] + # @see Expectations::ExpectationTarget#to + # @see Expectations::ExpectationTarget#not_to # Allows multiple expectations in the provided block to fail, and then # aggregates them into a single exception, rather than aborting on the @@ -1003,31 +1003,35 @@ is_a_matcher?(obj) && obj.respond_to?(:description) end - if RSpec::Support::Ruby.mri? && RUBY_VERSION[0, 3] == '1.9' - # @api private - # Note that `included` doesn't work for this because it is triggered - # _after_ `RSpec::Matchers` is an ancestor of the inclusion host, rather - # than _before_, like `append_features`. It's important we check this before - # in order to find the cases where it was already previously included. - def self.append_features(mod) - return super if mod < self # `mod < self` indicates a re-inclusion. - - subclasses = ObjectSpace.each_object(Class).select { |c| c < mod && c < self } - return super unless subclasses.any? - - subclasses.reject! { |s| subclasses.any? { |s2| s < s2 } } # Filter to the root ancestor. - subclasses = subclasses.map { |s| "`#{s}`" }.join(", ") - - RSpec.warning "`#{self}` has been included in a superclass (`#{mod}`) " \ - "after previously being included in subclasses (#{subclasses}), " \ - "which can trigger infinite recursion from `super` due to an MRI 1.9 bug " \ - "(https://redmine.ruby-lang.org/issues/3351). To work around this, " \ - "either upgrade to MRI 2.0+, include a dup of the module (e.g. " \ - "`include #{self}.dup`), or find a way to include `#{self}` in `#{mod}` " \ - "before it is included in subclasses (#{subclasses}). See " \ - "https://github.com/rspec/rspec-expectations/issues/814 for more info" + class << self + private - super + if RSpec::Support::Ruby.mri? && RUBY_VERSION[0, 3] == '1.9' + # Note that `included` doesn't work for this because it is triggered + # _after_ `RSpec::Matchers` is an ancestor of the inclusion host, rather + # than _before_, like `append_features`. It's important we check this before + # in order to find the cases where it was already previously included. + # @api private + def append_features(mod) + return super if mod < self # `mod < self` indicates a re-inclusion. + + subclasses = ObjectSpace.each_object(Class).select { |c| c < mod && c < self } + return super unless subclasses.any? + + subclasses.reject! { |s| subclasses.any? { |s2| s < s2 } } # Filter to the root ancestor. + subclasses = subclasses.map { |s| "`#{s}`" }.join(", ") + + RSpec.warning "`#{self}` has been included in a superclass (`#{mod}`) " \ + "after previously being included in subclasses (#{subclasses}), " \ + "which can trigger infinite recursion from `super` due to an MRI 1.9 bug " \ + "(https://redmine.ruby-lang.org/issues/3351). To work around this, " \ + "either upgrade to MRI 2.0+, include a dup of the module (e.g. " \ + "`include #{self}.dup`), or find a way to include `#{self}` in `#{mod}` " \ + "before it is included in subclasses (#{subclasses}). See " \ + "https://github.com/rspec/rspec-expectations/issues/814 for more info" + + super + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-06-10 22:14:19.000000000 +0200 +++ new/metadata 2019-10-07 23:35:25.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: rspec-expectations version: !ruby/object:Gem::Version - version: 3.8.4 + version: 3.9.0 platform: ruby authors: - Steven Baker @@ -45,7 +45,7 @@ ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ F3MdtaDehhjC -----END CERTIFICATE----- -date: 2019-06-10 00:00:00.000000000 Z +date: 2019-10-07 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rspec-support @@ -53,14 +53,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: 3.8.0 + version: 3.9.0 type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 3.8.0 + version: 3.9.0 - !ruby/object:Gem::Dependency name: diff-lcs requirement: !ruby/object:Gem::Requirement @@ -82,19 +82,19 @@ - !ruby/object:Gem::Version version: '2.0' - !ruby/object:Gem::Dependency - name: rake + name: aruba requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 10.0.0 + version: 0.14.10 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 10.0.0 + version: 0.14.10 - !ruby/object:Gem::Dependency name: cucumber requirement: !ruby/object:Gem::Requirement @@ -110,33 +110,33 @@ - !ruby/object:Gem::Version version: '1.3' - !ruby/object:Gem::Dependency - name: aruba + name: minitest requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.6.2 + version: '5.2' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.6.2 + version: '5.2' - !ruby/object:Gem::Dependency - name: minitest + name: rake requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.2' + version: 10.0.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: '5.2' + version: 10.0.0 description: rspec-expectations provides a simple, readable API to express expected outcomes of a code example. email: rspec@googlegroups.com @@ -202,7 +202,7 @@ - MIT metadata: bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues - changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.8.4/Changelog.md + changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.9.0/Changelog.md documentation_uri: https://rspec.info/documentation/ mailing_list_uri: https://groups.google.com/forum/#!forum/rspec source_code_uri: https://github.com/rspec/rspec-expectations @@ -222,8 +222,8 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.0.3 +rubygems_version: 3.0.6 signing_key: specification_version: 4 -summary: rspec-expectations-3.8.4 +summary: rspec-expectations-3.9.0 test_files: [] Binary files old/metadata.gz.sig and new/metadata.gz.sig differ
participants (1)
-
root