Sha256: 36f4490ee18922e1dcde60fbe6c8357174d9022c29c5c3b00fea7276d0da703d

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe Jack::Config::YamlFormatter do
  let(:sorter) { Jack::Config::YamlFormatter.new }

  describe "sorter" do
    it "process should sort the keys" do
      input = <<-EOL
EnvironmentConfigurationMetadata:
  Description: test.
  Foo: 1
AWSConfigurationTemplateVersion: 1.1.0.0
EOL
      file = "spec/fixtures/fake.cfg.yml"

      File.open(file, 'w') { |file| file.write(input) }
      sorter.process(file)
      output = File.read(file)

      expect(output).to eq <<-EOL
AWSConfigurationTemplateVersion: 1.1.0.0
EnvironmentConfigurationMetadata:
  Description: test.
  Foo: 1
EOL
    end

    it "process should strip date modified and created" do
      input = <<-EOL
EnvironmentConfigurationMetadata:
  DateModified: '1425215243000'
  Description: test.
  DateCreated: '1425215243000'
AWSConfigurationTemplateVersion: 1.1.0.0
EOL
      file = "spec/fixtures/fake.cfg.yml"

      File.open(file, 'w') { |file| file.write(input) }
      sorter.process(file)
      output = File.read(file)

      expect(output).to eq <<-EOL
AWSConfigurationTemplateVersion: 1.1.0.0
EnvironmentConfigurationMetadata:
  Description: test.
EOL
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jack-eb-1.4.3 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.4.2 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.4.1 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.4.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.3.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.2.1 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.2.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.1.2 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.1.1 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.1.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.0.1 spec/lib/config/yaml_formatter_spec.rb
jack-eb-1.0.0 spec/lib/config/yaml_formatter_spec.rb