Sha256: 414644f2902f9d15d4544c9ce4f8dcdb42c5e35aede30b6155657c54acab47a4
Contents?: true
Size: 628 Bytes
Versions: 5
Compression:
Stored size: 628 Bytes
Contents
require 'spec_helper' describe Dotenvious::ValueReplacer do describe '#replace' do before do stub_const('Dotenvious::ENV_EXAMPLE', {'fake' => 'correct'} ) end it "replaces the key's value in .env if user presses yes" do expect(File).to receive(:read). with('.env'). and_return("test=1234\nfake=missing") env_double = double('File', write: nil) expect(env_double).to receive(:write).with("test=1234\nfake=correct") expect(File).to receive(:open). with('.env', 'w'). and_return(env_double) described_class.new.replace('fake') end end end
Version data entries
5 entries across 5 versions & 1 rubygems