Sha256: df8058cffc7faa8b75370d66fc926a507be30c3a005a969c074f67002776c6c7

Contents?: true

Size: 1.14 KB

Versions: 1

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
AWSConfigurationTemplateVersion: 1.1.0.0
EnvironmentConfigurationMetadata:
  DateModified: '1425215243000'
  Description: test.
  DateCreated: '1425215243000'
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

1 entries across 1 versions & 1 rubygems

Version Path
jack-eb-1.4.4 spec/lib/config/yaml_formatter_spec.rb