Sha256: 4d1a9202d0b136c885578d58ed4dcc7a1bf03ffc413670a8926befaa3b3078ba
Contents?: true
Size: 480 Bytes
Versions: 23
Compression:
Stored size: 480 Bytes
Contents
class APIFixtures def initialize @fixtures = ::JSON.parse(File.read("#{PROJECT_ROOT}/spec/fixtures.json")) freeze_recursively(@fixtures) end def [](name) @fixtures[name] end def fetch(*args) @fixtures.fetch(*args) end def generate_json(name) JSON.generate(self.fetch(name)) end private def freeze_recursively(data) data.each do |k, v| if v.is_a?(Hash) freeze_recursively(v) end end data.freeze end end
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
myjohndeere-0.0.3 | test/api_fixtures.rb |
myjohndeere-0.0.2 | test/api_fixtures.rb |
myjohndeere-0.0.1 | test/api_fixtures.rb |