spec/archive_spec.rb in heirloom-0.3.1 vs spec/archive_spec.rb in heirloom-0.4.0
- old
+ new
@@ -1,16 +1,14 @@
require 'spec_helper'
describe Heirloom do
before do
- @config_mock = mock 'config'
- @logger_mock = mock 'logger'
- Heirloom::Config.should_receive(:new).and_return @config_mock
- @archive = Heirloom::Archive.new :logger => @logger_mock,
- :name => 'chef',
- :id => '123'
+ @config_mock = mock 'config'
+ @archive = Heirloom::Archive.new :config => @config_mock,
+ :name => 'chef',
+ :id => '123'
end
context "test public methods" do
@@ -188,8 +186,19 @@
:name => 'chef',
:id => '123').
and_return mock
mock.should_receive(:regions)
@archive.regions
+ end
+
+ it "should call the count method for an archive" do
+ mock = double('Mock')
+ Heirloom::Reader.should_receive(:new).
+ with(:config => @config_mock,
+ :name => 'chef',
+ :id => '123').
+ and_return mock
+ mock.should_receive(:count)
+ @archive.count
end
end
end