fixture_farm 0.2.0 → 0.2.1
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/README.md +6 -3
- data/lib/fixture_farm/fixture_recorder.rb +1 -1
- data/lib/fixture_farm/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: aff981f1a6701eb197d0a067391143ce166d4c64de2d3c449cfac8400bb48dd2
         | 
| 4 | 
            +
              data.tar.gz: 49d489ca4b85708d285db668ca2dcde57ac4a3aa52b394403ad82ccde4841196
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 138bcbab569d27a49c332ac24b814392aab3888e2cd49cf3b64e3f46b3b5a6f6c780d6f7aa355ceba410c900611b31c16dc7ead35af6d74431043391fb34cbce
         | 
| 7 | 
            +
              data.tar.gz: 22170db6fd9112ea4d67d6de74f270f4615a2d2ab07b02af913c2de516c952d4045685c19a1f382679046939ccf7425dc05c6742f934c58cddc4c7afa116f7b1
         | 
    
        data/README.md
    CHANGED
    
    | @@ -104,7 +104,9 @@ test 'authors fixtures must have at least one post' do | |
| 104 104 | 
             
            end
         | 
| 105 105 | 
             
            ```
         | 
| 106 106 |  | 
| 107 | 
            -
             | 
| 107 | 
            +
            Let's say this test is currently failing.
         | 
| 108 | 
            +
             | 
| 109 | 
            +
            Now let's add the option to automatically record missing fixtures:
         | 
| 108 110 |  | 
| 109 111 | 
             
            ```ruby
         | 
| 110 112 | 
             
            test 'authors fixtures must have at least one post' do
         | 
| @@ -116,12 +118,13 @@ test 'authors fixtures must have at least one post' do | |
| 116 118 | 
             
                    author.posts.create!(text: 'some text')
         | 
| 117 119 | 
             
                  end
         | 
| 118 120 | 
             
                end
         | 
| 119 | 
            -
              else
         | 
| 120 | 
            -
                assert_empty offending_records
         | 
| 121 121 | 
             
              end
         | 
| 122 | 
            +
             | 
| 123 | 
            +
              assert_empty offending_records
         | 
| 122 124 | 
             
            end
         | 
| 123 125 | 
             
            ```
         | 
| 124 126 |  | 
| 127 | 
            +
            Running this test with `RECORD_FIXTURES=1` will generate missing fixture entries in `test/fixtures/posts.yml`. Now re-run the test again and it's passing.
         | 
| 125 128 |  | 
| 126 129 | 
             
            ## License
         | 
| 127 130 | 
             
            The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
         | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 3 | 
             
            module FixtureFarm
         | 
| 4 | 
            -
              mattr_accessor :parent_models_to_ignore_when_naming_fixtures
         | 
| 4 | 
            +
              mattr_accessor :parent_models_to_ignore_when_naming_fixtures, default: []
         | 
| 5 5 |  | 
| 6 6 | 
             
              class FixtureRecorder
         | 
| 7 7 | 
             
                STORE_PATH = Rails.root.join('tmp', 'fixture_farm_store.json')
         | 
    
        data/lib/fixture_farm/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fixture_farm
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - artemave
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2025-03- | 
| 11 | 
            +
            date: 2025-03-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         |