Sha256: 3ea4580ca501b3620eb983d9bd66843941450135c5b6647cf24fb81defd19e57

Contents?: true

Size: 967 Bytes

Versions: 7

Compression:

Stored size: 967 Bytes

Contents

require 'spec_helper'
require 'heirloom/cli'

describe Heirloom do

  before do
    @attributes = { 'id'                  => '123',
                    'another_data'        => 'more_data',
                    'built_at'            => 'today',
                    'built_by'            => 'me',
                    'bucket_prefix'       => 'bp',
                    'us-west-1-s3-url'    => 's3',
                    'us-west-1-http-url'  => 'http',
                    'us-west-1-https-url' => 'https' }
  end

  it "should remove reserved / endpoint attribs" do
    formatter = Heirloom::CLI::Formatter::Show.new
    formatter.format(:attributes => @attributes).
              should_not match 'bucket_prefix|us-west-1-s3-url'
  end

  it "should format the id output correctly" do
    formatter = Heirloom::CLI::Formatter::Show.new
    formatter.format(:attributes => @attributes).
              should == "id           : 123\nanother_data : more_data"
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
heirloom-0.10.1 spec/cli/formatter/show_spec.rb
heirloom-0.10.0 spec/cli/formatter/show_spec.rb
heirloom-0.9.0 spec/cli/formatter/show_spec.rb
heirloom-0.8.3 spec/cli/formatter/show_spec.rb
heirloom-0.8.2 spec/cli/formatter/show_spec.rb
heirloom-0.8.1 spec/cli/formatter/show_spec.rb
heirloom-0.8.0 spec/cli/formatter/show_spec.rb