Sha256: d686d139bc24ac6852bad17ec7bb8b3250a09f5e0281c303f9788519635e737d

Contents?: true

Size: 785 Bytes

Versions: 4

Compression:

Stored size: 785 Bytes

Contents

require 'spec_helper'

describe "Smartdc::Api::Packages" do

  before(:all) do
    @object = Object.new
    @request = Smartdc::Request
  end

  describe ".read" do
    it "should return a package" do
      @object.stub(:content) {fixture('packages')[0]}
      name = @object.content['name']
      @request.stub_chain(:new, :get).with('my/packages/' + name) {@object}

      packages = Smartdc::Api::Packages.new({})
      packages.read(name).content['name'].should == name
    end
  end

  describe ".all" do
    it "should return some packages" do
      @object.stub(:content) {fixture('packages')}
      @request.stub_chain(:new, :get).with('my/packages', {}) {@object}

      packages = Smartdc::Api::Packages.new({})
      packages.all.content.count.should > 0
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
smartdc-1.2.2 spec/unit/smartdc/api/packages_spec.rb
smartdc-1.2.1 spec/unit/smartdc/api/packages_spec.rb
smartdc-1.1.1 spec/unit/smartdc/api/packages_spec.rb
smartdc-1.0.1 spec/unit/smartdc/api/packages_spec.rb