Sha256: 7c7461b3b4c3fcf60c7338792d3ef83a38f21c4efc87c272fef269512890634c
Contents?: true
Size: 1.19 KB
Versions: 13
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe Stackster do it "should create a list of entries" do @simple_db_mock = mock 'simple db' config = mock 'config mock' Stackster::AWS::SimpleDB.should_receive(:new).and_return @simple_db_mock @simple_db_mock.should_receive(:domain_exists?). with("stacks"). and_return true @simple_db_mock.should_receive(:select). with("select * from stacks"). and_return('stack-to-find-us-west-1' => { 'attr1' => 'value1' }) entry_lister = Stackster::EntryLister.new :config => config entry_lister.all.should == ['stack-to-find'] end it "should return a blank array if the domain does not exist" do @simple_db_mock = mock 'simple db' config = mock 'config mock' Stackster::AWS::SimpleDB.should_receive(:new).and_return @simple_db_mock @simple_db_mock.should_receive(:domain_exists?). with("stacks"). and_return false @simple_db_mock.should_receive(:select). with("select * from stacks").exactly(0).times entry_lister = Stackster::EntryLister.new :config => config entry_lister.all.should == [] end end
Version data entries
13 entries across 13 versions & 1 rubygems