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

Version Path
stripe-3.0.3 test/api_fixtures.rb
stripe-3.0.1 test/api_fixtures.rb
stripe-3.0.0 test/api_fixtures.rb
stripe-2.12.0 test/api_fixtures.rb
stripe-2.11.0 test/api_fixtures.rb
stripe-2.10.0 test/api_fixtures.rb
stripe-2.9.0 test/api_fixtures.rb
stripe-2.8.0 test/api_fixtures.rb
stripe-2.7.0 test/api_fixtures.rb
stripe-2.6.0 test/api_fixtures.rb
stripe-2.5.0 test/api_fixtures.rb
stripe-2.4.0 test/api_fixtures.rb
stripe-2.3.0 test/api_fixtures.rb
stripe-2.2.1 test/api_fixtures.rb
stripe-2.2.0 test/api_fixtures.rb