spec/unit/configuration/setup_spec.rb in imap-backup-1.0.11 vs spec/unit/configuration/setup_spec.rb in imap-backup-1.0.12
- old
+ new
@@ -13,17 +13,18 @@
end
context '#run' do
let(:account1) { {:username => 'account@example.com'} }
let(:account) { double('Imap::Backup::Configuration::Account', :run => nil) }
- let(:data) { {:accounts => [account1]} }
+ let(:accounts) { [account1] }
let(:store) do
double(
'Imap::Backup::Configuration::Store',
- :data => data,
+ :accounts => accounts,
:path => '/base/path',
- :save => nil
+ :save => nil,
+ :debug? => false,
)
end
before :each do
allow(Imap::Backup::Configuration::Store).to receive(:new).and_return(store)
@@ -74,10 +75,10 @@
subject.run
end
it 'adds account data' do
- expect(data[:accounts][1]).to eq(blank_account)
+ expect(accounts[1]).to eq(blank_account)
end
end
it 'should save the configuration' do
allow(@input).to receive(:gets).and_return("save\n")