Sha256: c4d09b94e5484a53243b47b5830e2f1ec051578e9494d26462013ca980983ada

Contents?: true

Size: 641 Bytes

Versions: 2

Compression:

Stored size: 641 Bytes

Contents

require 'spec_helper'

describe PuppetForge::V3::Base do
  describe '::new_collection' do
    it 'should handle responses with no results' do
      response_data = { data: {}, errors: "Something bad happened!" }

      expect(PuppetForge::V3::Base.new_collection(response_data)).to eq([])
    end

    it 'should handle responses with no pagination info' do
      response_data = { data: {}, errors: "Something bad happened!" }

      collection = PuppetForge::V3::Base.new_collection(response_data)

      expect(collection.limit).to eq(10)
      expect(collection.offset).to eq(0)
      expect(collection.total).to eq(0)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet_forge-1.0.6 spec/unit/forge/v3/base_spec.rb
puppet_forge-1.0.5 spec/unit/forge/v3/base_spec.rb