matest 1.6.9 → 1.7.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 +4 -4
 - data/lib/matest/example.rb +1 -0
 - data/lib/matest/spec_printer.rb +6 -5
 - data/lib/matest/version.rb +1 -1
 - data/spec/matest_specs/explanation_spec.rb +17 -0
 - metadata +5 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 5c7b101e40bda15067b116796ccb0060a9f6b607
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: d85e60ef5c8febc5576dd564b3573a3a5b1aaf06
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 4126278afdc314d82a5c72664e55e7b184da2287a37103f49cf0ef7bb701e246f1702568b3dd9ce1c89c74c9d11ae73a1f13f91b81f4738ef4e9d8061b3cec41
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ec48e865d456f5b58c1bf0cd5000b8a469bccdfa4e81c54c8a86edb4b736b0d8f8699fb0350b90092c5e2182ab3ff036cf551249d3dce37acd1653e1d28dfb82
         
     | 
    
        data/lib/matest/example.rb
    CHANGED
    
    
    
        data/lib/matest/spec_printer.rb
    CHANGED
    
    | 
         @@ -81,12 +81,14 @@ module Matest 
     | 
|
| 
       81 
81 
     | 
    
         
             
                  end
         
     | 
| 
       82 
82 
     | 
    
         
             
                end
         
     | 
| 
       83 
83 
     | 
    
         | 
| 
       84 
     | 
    
         
            -
                def print_subexpression( 
     | 
| 
       85 
     | 
    
         
            -
                  just_before_assertion = status.example.just_before_assertion
         
     | 
| 
       86 
     | 
    
         
            -
                   
     | 
| 
      
 84 
     | 
    
         
            +
                def print_subexpression(subexpression, status)
         
     | 
| 
      
 85 
     | 
    
         
            +
                  just_before_assertion = status.example.just_before_assertion.code
         
     | 
| 
      
 86 
     | 
    
         
            +
                  code = just_before_assertion + subexpression
         
     | 
| 
      
 87 
     | 
    
         
            +
                  
         
     | 
| 
      
 88 
     | 
    
         
            +
                  result = Evaluator.new(just_before_assertion, proc{}).eval_string(code)
         
     | 
| 
       87 
89 
     | 
    
         
             
                  if result.class != Matest::EvalErr
         
     | 
| 
       88 
90 
     | 
    
         
             
                    explanation = []
         
     | 
| 
       89 
     | 
    
         
            -
                    explanation << expression("  #{ 
     | 
| 
      
 91 
     | 
    
         
            +
                    explanation << expression("  #{subexpression}")
         
     | 
| 
       90 
92 
     | 
    
         
             
                    explanation << "\n"
         
     | 
| 
       91 
93 
     | 
    
         
             
                    explanation << value("    # => #{result}")
         
     | 
| 
       92 
94 
     | 
    
         
             
                    puts explanation.join
         
     | 
| 
         @@ -96,7 +98,6 @@ module Matest 
     | 
|
| 
       96 
98 
     | 
    
         
             
              The assertion couldn't be explained.
         
     | 
| 
       97 
99 
     | 
    
         
             
              The error message was:
         
     | 
| 
       98 
100 
     | 
    
         
             
                #{result}
         
     | 
| 
       99 
     | 
    
         
            -
              Make sure you are not calling any local vaiables on your code assertion.
         
     | 
| 
       100 
101 
     | 
    
         
             
                  CODE
         
     | 
| 
       101 
102 
     | 
    
         
             
                    puts error(code)
         
     | 
| 
       102 
103 
     | 
    
         
             
                    false
         
     | 
    
        data/lib/matest/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: matest
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.7.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Federico Iachetti
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-08-20 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -100,6 +100,7 @@ files: 
     | 
|
| 
       100 
100 
     | 
    
         
             
            - matest.gemspec
         
     | 
| 
       101 
101 
     | 
    
         
             
            - spec/matest_spec.rb
         
     | 
| 
       102 
102 
     | 
    
         
             
            - spec/matest_specs/aliases_spec.rb
         
     | 
| 
      
 103 
     | 
    
         
            +
            - spec/matest_specs/explanation_spec.rb
         
     | 
| 
       103 
104 
     | 
    
         
             
            - spec/matest_specs/failing_spec.rb
         
     | 
| 
       104 
105 
     | 
    
         
             
            - spec/matest_specs/matchers_spec.rb
         
     | 
| 
       105 
106 
     | 
    
         
             
            - spec/matest_specs/nested_scopes_spec.rb
         
     | 
| 
         @@ -130,13 +131,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       130 
131 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       131 
132 
     | 
    
         
             
            requirements: []
         
     | 
| 
       132 
133 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       133 
     | 
    
         
            -
            rubygems_version: 2.4. 
     | 
| 
      
 134 
     | 
    
         
            +
            rubygems_version: 2.4.8
         
     | 
| 
       134 
135 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       135 
136 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       136 
137 
     | 
    
         
             
            summary: Tests gasoleros (cheap tests).
         
     | 
| 
       137 
138 
     | 
    
         
             
            test_files:
         
     | 
| 
       138 
139 
     | 
    
         
             
            - spec/matest_spec.rb
         
     | 
| 
       139 
140 
     | 
    
         
             
            - spec/matest_specs/aliases_spec.rb
         
     | 
| 
      
 141 
     | 
    
         
            +
            - spec/matest_specs/explanation_spec.rb
         
     | 
| 
       140 
142 
     | 
    
         
             
            - spec/matest_specs/failing_spec.rb
         
     | 
| 
       141 
143 
     | 
    
         
             
            - spec/matest_specs/matchers_spec.rb
         
     | 
| 
       142 
144 
     | 
    
         
             
            - spec/matest_specs/nested_scopes_spec.rb
         
     |