Sha256: 5d8170c2f6391576d47d91be9ac8fa4e2292a9b98b4b66ea3fe58909db31f465

Contents?: true

Size: 653 Bytes

Versions: 2

Compression:

Stored size: 653 Bytes

Contents

require 'spec_helper'
require 'envault'

describe Envault do
  it "escape_yaml" do
    @envs = {
      'USERNAME_A' => 'hogehoge',
      'PASSWORD_A' => 'hogehoge',
      'API_KEY_A' => 'fugafuga'
    }

    yaml = Formatter.escape_yaml(@envs)
    expect(yaml).to eq("USERNAME_A: \"hogehoge\"\nPASSWORD_A: \"hogehoge\"\nAPI_KEY_A: \"fugafuga\"")
  end

  it "escape_yaml not quote" do
    @envs = {
      'USERNAME_A' => 'hogehoge',
      'PASSWORD_A' => 'hogehoge',
      'API_KEY_A' => 'fugafuga'
    }

    yaml = Formatter.escape_yaml(@envs, false)
    expect(yaml).to eq("USERNAME_A: hogehoge\nPASSWORD_A: hogehoge\nAPI_KEY_A: fugafuga")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
envault-0.2.2 spec/formatter_spec.rb
envault-0.2.1 spec/formatter_spec.rb