Sha256: afd3a05b8d3f96c12947135d6cc485aebfe50c34d139d5b7e711185ad8f2fc97

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

require File.expand_path(File.join(__FILE__, '../../..', 'test_helper'))
require 'rubber/cloud/aws/vpc'
require 'ostruct'

class AwsVpcTest < Test::Unit::TestCase

  context "aws" do

    setup do
      env = {'access_key' => "XXX", 'secret_access_key' => "YYY", 'region' => "us-east-1"}
      env = Rubber::Configuration::Environment::BoundEnv.new(env, nil, nil, nil)
      @cloud = Rubber::Cloud::Aws::Vpc.new(env, nil)
    end

    should "instantiate" do
      assert @cloud.compute_provider
      assert @cloud.storage_provider
    end

    should "provide storage" do
      assert @cloud.storage('mybucket')
    end

    should "provide table store" do
      assert @cloud.table_store('somekey')
    end

    should "create instance" do
      assert @cloud.create_instance('', '', '', '', '', '')
    end

    should "create instance with opts" do
      assert @cloud.create_instance('', '', '', '', '', '', :ebs_optimized => true)
    end
  end

  context "aws with alternative region" do

    setup do
      @region = "ap-southeast-2"
      env = {'access_key' => "XXX", 'secret_access_key' => "YYY", 'region' => @region}
      env = Rubber::Configuration::Environment::BoundEnv.new(env, nil, nil, nil)
      @cloud = Rubber::Cloud::Aws::Vpc.new(env, nil)
    end

    should "set region on compute provider" do
      assert_equal @cloud.compute_provider.region, @region
    end

    should "set region on storage provider" do
      assert_equal @cloud.storage_provider.region, @region
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubber-3.2.2 test/cloud/aws/vpc_test.rb
rubber-3.2.1 test/cloud/aws/vpc_test.rb
rubber-3.2.0 test/cloud/aws/vpc_test.rb