Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test that demonstrates bug in state update logic
This commit demonstrates a bug in state handling. Every modification involves a read, modify, write. This unit test mocks out just enough to show that a state file with ssl -> true is read correctly, changed, then produces an invalid json file with two entries in the hash with the same key. This is the key issue as reported in facebook#115. ``` [malmond@devvm1846.vll1 ~/local/taste-tester] /opt/chefdk/embedded/bin/rspec . F Failures: 1) TasteTester::State should serialize changes correctly Failure/Error: expect(@buffer.string).to eq('{"ssl":false}') expected: "{\"ssl\":false}" got: "{\"ssl\":true,\"ssl\":false}" (compared using ==) # ./spec/taste-tester_spec.rb:20:in `block (2 levels) in <top # (required)>' Finished in 0.01544 seconds (files took 0.27334 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/taste-tester_spec.rb:6 # TasteTester::State should serialize changes correctly ``` Signed-off-by: Matthew Almond <malmond@fb.com>
- Loading branch information