Sha256: aa55135ecb3a9aaeccdab7f5c8e285a7b6dd28af75e1a5caf2e79cb8490838e8
Contents?: true
Size: 1.57 KB
Versions: 54
Compression:
Stored size: 1.57 KB
Contents
require_relative '../../support/spec_helper' describe Henry::Input do describe '#export!' do let :params do {test:'this'} end it 'should set the Input::EXPORT_KEY' do Henry::Input.export! params ENV[Henry::Input::EXPORT_KEY].should == '{"test":"this"}' end describe 'for an instance' do let :input do Henry::Input.new({test:"this instance"}) end it 'should set the Input::EXPORT_KEY' do input.export! ENV[Henry::Input::EXPORT_KEY].should == '{"test":"this instance"}' end end end describe '#import!' do describe 'when Input::EXPORT_KEY is set' do it 'should import the Input::EXPORT_KEY as hash' do ENV[Henry::Input::EXPORT_KEY] = '{"test":"that"}' Henry::Input.import!.params.should == {"test"=>"that"} end end describe 'when Input::EXPORT_KEY is not set' do it 'should import the Input::EXPORT_KEY as hash' do ENV[Henry::Input::EXPORT_KEY] = nil Henry::Input.import!.params.should == {} end end describe 'for an instance' do describe 'when Input::EXPORT_KEY is not set' do let :input do Henry::Input.new end it 'should import the Input::EXPORT_KEY as hash' do ENV[Henry::Input::EXPORT_KEY] = nil input.should_receive(:warn).with("Could not load the execution params.\nAre you running this Task via the henry-ruby-container? You should!".red) input.import! end end end end end
Version data entries
54 entries across 54 versions & 1 rubygems