Sha256: 57e9a46fadf9b1980e0e9e59f0a687b69b5ecab6e83e277af41f545ee53ae1f4

Contents?: true

Size: 433 Bytes

Versions: 3

Compression:

Stored size: 433 Bytes

Contents

require 'spec_helper'

describe Dotenvious::CLI::EnvFileSorter do
  describe '#run' do
    it "sorts the key-value pairs back into .env" do
      stub_const('Dotenvious::ENV', {'TEST' => 'same', 'ABC' => '123'} )

      fake_file = double
      expect(fake_file).to receive(:write).with("ABC=123\nTEST=same")
      expect(File).to receive(:open).with('.env', 'w').and_yield fake_file

      described_class.new.run
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dotenvious-0.0.7 spec/dotenvious/cli/env_file_sorter_spec.rb
dotenvious-0.0.6 spec/dotenvious/cli/env_file_sorter_spec.rb
dotenvious-0.0.5 spec/dotenvious/cli/env_file_sorter_spec.rb