Sha256: 23448f04086e62387b9a24b67fbd93e38aeb71957e613f3942a59b2d8a4c6f76

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

require 'spec_helper'

describe Dotenvious::EnvAppender do
  describe '#append' do
    before do
      stub_const('Dotenvious::ENV', { 'test' => 'example' } )
      stub_const('Dotenvious::ENV_EXAMPLE', { 'test' => 'example', 'test2' => 'example2' } )
    end
    it 'appends the value to the end of the .env file' do
      env_double = double('File', write: nil)
      expect(env_double).to receive(:write).with("test2=example2\n")
      expect(env_double).to receive(:close)
      expect(File).to receive(:open).
        with('.big-ol-env', 'a+').once.
        and_return(env_double)

      described_class.new('.big-ol-env').append('test2')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dotenvious-0.0.7 spec/dotenvious/env_appender_spec.rb