Sha256: 4877223bb31c461b4c07a41e0c188d89f40754c1fbd334492d4a75fbb02842da

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Sdbport::CLI::Destroy do
  before do
    @domain_mock = mock "domain"
    @logger_stub = stub "logger"
    @options = { :name       => 'daname',
                 :region     => 'us-west-1',
                 :secret_key => 'private',
                 :access_key => 'abc',
                 :level      => 'debug' }

    Sdbport::SdbportLogger.should_receive(:new).
                           with(:log_level => 'debug').
                           and_return @logger_stub
    @destroy = Sdbport::CLI::Destroy.new
  end

  it "should perform destroy the domain" do
    Trollop.stub :options => @options
    Sdbport::Domain.should_receive(:new).
                    with(:name       => 'daname',
                         :region     => 'us-west-1',
                         :secret_key => 'private',
                         :access_key => 'abc',
                         :logger     => @logger_stub).
                    and_return @domain_mock
    @domain_mock.should_receive(:destroy).and_return true
    @destroy.destroy
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sdbport-0.4.1 spec/cli/destroy_spec.rb
sdbport-0.4.0 spec/cli/destroy_spec.rb