Sha256: 7ebfd2766431bbdf27fbaee8d691020ac03b9947134884a33cd8c570e711010a

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class PlansResourceTest < Minitest::Test
  def test_list
    stub = stub_request("plans", response: stub_response(fixture: "plans/list"))
    client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
    plans = client.plans.list

    assert_equal Vultr::Collection, plans.class
    assert_equal Vultr::Plan, plans.data.first.class
    assert_equal 1, plans.total
  end

  def test_list_metal
    stub = stub_request("plans-metal", response: stub_response(fixture: "plans/list_metal"))
    client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
    plans = client.plans.list_metal

    assert_equal Vultr::Collection, plans.class
    assert_equal Vultr::Plan, plans.data.first.class
    assert_equal 1, plans.total
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vultr-2.0.0 test/vultr/resources/plans_test.rb
vultr-1.0.0 test/vultr/resources/plans_test.rb