Sha256: 42d536d9c646f6fba29a1a8eca3d1ec72b141442481d2dfb3fa8747adead5de6
Contents?: true
Size: 619 Bytes
Versions: 15
Compression:
Stored size: 619 Bytes
Contents
# APIFixtures loads fixture data generated by the core Stripe API so that we # can have slightly more accurate and up-to-date resource information in our # tests. class APIFixtures def initialize @fixtures = ::JSON.parse(File.read("#{PROJECT_ROOT}/openapi/fixtures.json"), symbolize_names: true)[:resources] freeze_recursively(@fixtures) end def [](name) @fixtures[name] end def fetch(*args) @fixtures.fetch(*args) 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
15 entries across 15 versions & 1 rubygems