rspec-expectations 3.10.1 → 3.10.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +15 -0
- data/README.md +1 -1
- data/lib/rspec/expectations/expectation_target.rb +3 -5
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/include.rb +1 -1
- data/lib/rspec/matchers/built_in/raise_error.rb +9 -3
- data.tar.gz.sig +0 -0
- metadata +7 -7
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a1042199b6d7c762e4a79740c4996cfb198c2a5599091f9e80c4b934021dcfdd
         | 
| 4 | 
            +
              data.tar.gz: 4aadaf8516b655b927d4daa574851e4d2113b7c0294b83f01a751b0ee785d11e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f78ad1ed8b49b3ad14c101221cfc8d380f01e31ea4c374b480ca1a514e26a3933bb05b1a1123e12cadaa5aff1d35b6e556703f0783f297dc0502e3ff2306404f
         | 
| 7 | 
            +
              data.tar.gz: 8998ea12bd8f10ae89b18b2e138b338839202db95bb88328b16ce5435422c1cc1f2b6625f2a97aa653749ca33e93a288db7720526da954e01999214d99eb798d
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/Changelog.md
    CHANGED
    
    | @@ -1,3 +1,18 @@ | |
| 1 | 
            +
            ### Development
         | 
| 2 | 
            +
            [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.2...3-10-maintenance)
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            ### 3.10.2 / 2022-01-14
         | 
| 5 | 
            +
            [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.1...v3.10.2)
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Bug Fixes:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            * Fix support for dynamic matchers for expectation target checks (Phil Pirozhkov, #1294)
         | 
| 10 | 
            +
            * Fix `expect(array).to include(hash).times`, previously this would fail due to
         | 
| 11 | 
            +
              matching the entire array as a single hash, rather than a member of the hash.
         | 
| 12 | 
            +
              (Slava Kardakov, #1322)
         | 
| 13 | 
            +
            * Ensure `raise_error` matches works with the `error_highlight` option from Ruby 3.1.
         | 
| 14 | 
            +
              (Peter Goldstein, #1339)
         | 
| 15 | 
            +
             | 
| 1 16 | 
             
            ### 3.10.1 / 2020-12-27
         | 
| 2 17 | 
             
            [Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.0...v3.10.1)
         | 
| 3 18 |  | 
    
        data/README.md
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            # RSpec Expectations [](https://github.com/rspec/rspec-expectations/actions) [](https://codeclimate.com/github/rspec/rspec-expectations)
         | 
| 2 2 |  | 
| 3 3 | 
             
            RSpec::Expectations lets you express expected outcomes on an object in an
         | 
| 4 4 | 
             
            example.
         | 
| @@ -57,7 +57,7 @@ module RSpec | |
| 57 57 | 
             
                    #   expect { perform }.to raise_error
         | 
| 58 58 | 
             
                    # @param [Matcher]
         | 
| 59 59 | 
             
                    #   matcher
         | 
| 60 | 
            -
                    # @param [String  | 
| 60 | 
            +
                    # @param [String, Proc] message optional message to display when the expectation fails
         | 
| 61 61 | 
             
                    # @return [Boolean] true if the expectation succeeds (else raises)
         | 
| 62 62 | 
             
                    # @see RSpec::Matchers
         | 
| 63 63 | 
             
                    def to(matcher=nil, message=nil, &block)
         | 
| @@ -70,7 +70,7 @@ module RSpec | |
| 70 70 | 
             
                    #   expect(value).not_to eq(5)
         | 
| 71 71 | 
             
                    # @param [Matcher]
         | 
| 72 72 | 
             
                    #   matcher
         | 
| 73 | 
            -
                    # @param [String  | 
| 73 | 
            +
                    # @param [String, Proc] message optional message to display when the expectation fails
         | 
| 74 74 | 
             
                    # @return [Boolean] false if the negative expectation succeeds (else raises)
         | 
| 75 75 | 
             
                    # @see RSpec::Matchers
         | 
| 76 76 | 
             
                    def not_to(matcher=nil, message=nil, &block)
         | 
| @@ -118,9 +118,7 @@ module RSpec | |
| 118 118 | 
             
                  end
         | 
| 119 119 |  | 
| 120 120 | 
             
                  def supports_block_expectations?(matcher)
         | 
| 121 | 
            -
                    matcher.supports_block_expectations?
         | 
| 122 | 
            -
                  rescue NoMethodError
         | 
| 123 | 
            -
                    false
         | 
| 121 | 
            +
                    matcher.respond_to?(:supports_block_expectations?) && matcher.supports_block_expectations?
         | 
| 124 122 | 
             
                  end
         | 
| 125 123 | 
             
                end
         | 
| 126 124 | 
             
              end
         | 
| @@ -182,7 +182,7 @@ module RSpec | |
| 182 182 | 
             
                      when String
         | 
| 183 183 | 
             
                        actual.scan(expected.first).length
         | 
| 184 184 | 
             
                      when Enumerable
         | 
| 185 | 
            -
                        count_enumerable(expected.first)
         | 
| 185 | 
            +
                        count_enumerable(Hash === expected ? expected : expected.first)
         | 
| 186 186 | 
             
                      else
         | 
| 187 187 | 
             
                        raise NotImplementedError, 'Count constraints are implemented for Enumerable and String values only'
         | 
| 188 188 | 
             
                      end
         | 
| @@ -59,7 +59,7 @@ module RSpec | |
| 59 59 | 
             
                        given_proc.call
         | 
| 60 60 | 
             
                      rescue Exception => @actual_error
         | 
| 61 61 | 
             
                        if values_match?(@expected_error, @actual_error) ||
         | 
| 62 | 
            -
                           values_match?(@expected_error,  | 
| 62 | 
            +
                           values_match?(@expected_error, actual_error_message)
         | 
| 63 63 | 
             
                          @raised_expected_error = true
         | 
| 64 64 | 
             
                          @with_expected_message = verify_message
         | 
| 65 65 | 
             
                        end
         | 
| @@ -93,7 +93,7 @@ module RSpec | |
| 93 93 | 
             
                    # @api private
         | 
| 94 94 | 
             
                    # @return [String]
         | 
| 95 95 | 
             
                    def failure_message
         | 
| 96 | 
            -
                      @eval_block ?  | 
| 96 | 
            +
                      @eval_block ? actual_error_message : "expected #{expected_error}#{given_error}"
         | 
| 97 97 | 
             
                    end
         | 
| 98 98 |  | 
| 99 99 | 
             
                    # @api private
         | 
| @@ -110,6 +110,12 @@ module RSpec | |
| 110 110 |  | 
| 111 111 | 
             
                  private
         | 
| 112 112 |  | 
| 113 | 
            +
                    def actual_error_message
         | 
| 114 | 
            +
                      return nil unless @actual_error
         | 
| 115 | 
            +
             | 
| 116 | 
            +
                      @actual_error.respond_to?(:original_message) ? @actual_error.original_message : @actual_error.message
         | 
| 117 | 
            +
                    end
         | 
| 118 | 
            +
             | 
| 113 119 | 
             
                    def expectation_matched?
         | 
| 114 120 | 
             
                      error_and_message_match? && block_matches?
         | 
| 115 121 | 
             
                    end
         | 
| @@ -138,7 +144,7 @@ module RSpec | |
| 138 144 |  | 
| 139 145 | 
             
                    def verify_message
         | 
| 140 146 | 
             
                      return true if @expected_message.nil?
         | 
| 141 | 
            -
                      values_match?(@expected_message,  | 
| 147 | 
            +
                      values_match?(@expected_message, actual_error_message.to_s)
         | 
| 142 148 | 
             
                    end
         | 
| 143 149 |  | 
| 144 150 | 
             
                    def warn_for_negative_false_positives!
         | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rspec-expectations
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 3.10. | 
| 4 | 
            +
              version: 3.10.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Steven Baker
         | 
| @@ -45,7 +45,7 @@ cert_chain: | |
| 45 45 | 
             
              ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
         | 
| 46 46 | 
             
              F3MdtaDehhjC
         | 
| 47 47 | 
             
              -----END CERTIFICATE-----
         | 
| 48 | 
            -
            date:  | 
| 48 | 
            +
            date: 2022-01-14 00:00:00.000000000 Z
         | 
| 49 49 | 
             
            dependencies:
         | 
| 50 50 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 51 51 | 
             
              name: rspec-support
         | 
| @@ -99,14 +99,14 @@ dependencies: | |
| 99 99 | 
             
              name: cucumber
         | 
| 100 100 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 101 101 | 
             
                requirements:
         | 
| 102 | 
            -
                - - " | 
| 102 | 
            +
                - - ">="
         | 
| 103 103 | 
             
                  - !ruby/object:Gem::Version
         | 
| 104 104 | 
             
                    version: '1.3'
         | 
| 105 105 | 
             
              type: :development
         | 
| 106 106 | 
             
              prerelease: false
         | 
| 107 107 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 108 108 | 
             
                requirements:
         | 
| 109 | 
            -
                - - " | 
| 109 | 
            +
                - - ">="
         | 
| 110 110 | 
             
                  - !ruby/object:Gem::Version
         | 
| 111 111 | 
             
                    version: '1.3'
         | 
| 112 112 | 
             
            - !ruby/object:Gem::Dependency
         | 
| @@ -203,7 +203,7 @@ licenses: | |
| 203 203 | 
             
            - MIT
         | 
| 204 204 | 
             
            metadata:
         | 
| 205 205 | 
             
              bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
         | 
| 206 | 
            -
              changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.10. | 
| 206 | 
            +
              changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.10.2/Changelog.md
         | 
| 207 207 | 
             
              documentation_uri: https://rspec.info/documentation/
         | 
| 208 208 | 
             
              mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
         | 
| 209 209 | 
             
              source_code_uri: https://github.com/rspec/rspec-expectations
         | 
| @@ -223,8 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 223 223 | 
             
                - !ruby/object:Gem::Version
         | 
| 224 224 | 
             
                  version: '0'
         | 
| 225 225 | 
             
            requirements: []
         | 
| 226 | 
            -
            rubygems_version: 3. | 
| 226 | 
            +
            rubygems_version: 3.3.3
         | 
| 227 227 | 
             
            signing_key:
         | 
| 228 228 | 
             
            specification_version: 4
         | 
| 229 | 
            -
            summary: rspec-expectations-3.10. | 
| 229 | 
            +
            summary: rspec-expectations-3.10.2
         | 
| 230 230 | 
             
            test_files: []
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |