Sha256: 5d7d7859e34d34179bf9cf5cff453cecb384f995db825e7e4efbcb805713d7fa

Contents?: true

Size: 1.15 KB

Versions: 17

Compression:

Stored size: 1.15 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

17 entries across 17 versions & 1 rubygems

Version Path
jack-eb-0.3.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.2.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.6 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.5 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.4 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.3 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.2 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.1 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.1.0 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.9 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.8 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.7 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.6 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.4 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.3 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.2 spec/lib/config/yaml_formatter_spec.rb
jack-eb-0.0.1 spec/lib/config/yaml_formatter_spec.rb