Sha256: 5abd84fc02af2037da223513dc5a97b78116914ea68ce2bca422d3bafc1f273f

Contents?: true

Size: 1.76 KB

Versions: 3

Compression:

Stored size: 1.76 KB

Contents

require "spec_helper"
require "aws/rikanjo"

describe 'AWS::Rikanjo' do

  it "is previous instance type" do
    %w{ m1.medium c1.medium m2.xlarge cc2.8xlarge cr1.8xlarge hi1.4xlarge cg1.4xlarge }.each do |t|
        a = Aws::RiKanjoo.new(
            region        = 'ap-northeast-1',
            instance_type = t,
            ri_util       = 'light',
        )
        expect(a.previous_generation_type).to eq true
    end
  end

  it "is current instance type" do
    %w{ t1.micro m1.small m3.medium c3.medium r3.xlarge i2.xlarge }.each do |t|
        a = Aws::RiKanjoo.new(
            region        = 'ap-northeast-1',
            instance_type = t,
            ri_util       = 'light',
        )
        expect(a.previous_generation_type).to eq false
    end
  end

  it "build previous price url" do
    a = Aws::RiKanjoo.new(
        region        = 'ap-northeast-1',
        instance_type = 'm1.medium',
        ri_util       = 'light',
    )
    expect(a.price_url).to eq "http://a0.awsstatic.com/pricing/1/ec2/previous-generation"
  end

  it "build current price url" do
    a = Aws::RiKanjoo.new(
        region        = 'ap-northeast-1',
        instance_type = 'm3.medium',
        ri_util       = 'light',
    )
    expect(a.price_url).to eq "http://a0.awsstatic.com/pricing/1/ec2"
  end

  it "build previous ri price file" do
    a = Aws::RiKanjoo.new(
        region        = 'ap-northeast-1',
        instance_type = 'm1.medium',
        ri_util       = 'light',
    )
    expect(a.ri_price_file).to eq "light_linux.min.js"
  end

  it "build current ri price file" do
    a = Aws::RiKanjoo.new(
        region        = 'ap-northeast-1',
        instance_type = 'm3.medium',
        ri_util       = 'heavy',
    )
    expect(a.ri_price_file).to eq "linux-ri-heavy.min.js"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-rikanjo-0.0.6 spec/lib/rikanjo_spec.rb
aws-rikanjo-0.0.5 spec/lib/rikanjo_spec.rb
aws-rikanjo-0.0.4 spec/lib/rikanjo_spec.rb