require 'spec_helper' module Queuel module SQS describe Queue do let(:message) { double "Message", body: "uhuh" } let(:client) { double "ClientObject" } let(:name) { "venues queue" } let(:credentials) {{ access_key: "none", secret_access_key: "none" }} let(:queue_object_with_message) { double "QueueObject", get: message, receive_message: message } let(:queue_object_with_nil_message) { double "QueueObject", get: nil, receive_message: nil } subject do described_class.new client, name, credentials end before do message.stub_chain :as_sns_message, body: "uhuh" client.stub_chain :queues, named: queue_object_with_message end it_should_behave_like "a queue" describe "size" do it "should check the queue_connection's approximate_number_of_messages for size" do queue_object_with_message.should_receive :approximate_number_of_messages subject.size end end end end end