Module: FakeSNS

Defined in:
lib/fake_sns.rb,
lib/fake_sns/error.rb,
lib/fake_sns/topic.rb,
lib/fake_sns/action.rb,
lib/fake_sns/server.rb,
lib/fake_sns/message.rb,
lib/fake_sns/storage.rb,
lib/fake_sns/version.rb,
lib/fake_sns/database.rb,
lib/fake_sns/response.rb,
lib/fake_sns/show_output.rb,
lib/fake_sns/subscription.rb,
lib/fake_sns/error_response.rb,
lib/fake_sns/actions/publish.rb,
lib/fake_sns/deliver_message.rb,
lib/fake_sns/test_integration.rb,
lib/fake_sns/topic_collection.rb,
lib/fake_sns/actions/subscribe.rb,
lib/fake_sns/message_collection.rb,
lib/fake_sns/actions/list_topics.rb,
lib/fake_sns/actions/create_topic.rb,
lib/fake_sns/actions/delete_topic.rb,
lib/fake_sns/subscription_collection.rb,
lib/fake_sns/actions/list_subscriptions.rb,
lib/fake_sns/actions/get_topic_attributes.rb,
lib/fake_sns/actions/set_topic_attributes.rb,
lib/fake_sns/actions/list_subscriptions_by_topic.rb,
lib/fake_sns/actions/set_subscription_attributes.rb

Defined Under Namespace

Modules: Actions Classes: Action, Database, DeliverMessage, Error, ErrorResponse, FileStorage, MemoryStorage, Message, MessageCollection, Response, Server, ShowOutput, Storage, Subscription, SubscriptionCollection, TestIntegration, Topic, TopicCollection

Constant Summary collapse

IncompleteSignature =

Common Errors, according to AWS docs

error_type 400
InternalFailure =
error_type 500
InvalidAction =
error_type 400
InvalidClientTokenId =
error_type 403
InvalidParameterCombination =
error_type 400
InvalidParameterValue =
error_type 400
InvalidQueryParameter =
error_type 400
MalformedQueryString =
error_type 400
MissingAction =
error_type 400
MissingAuthenticationToken =
error_type 403
MissingParameter =
error_type 400
OptInRequired =
error_type 403
RequestExpired =
error_type 400
ServiceUnavailable =
error_type 403
Throttling =
error_type 400
NotFound =

Other errors

error_type 404
VERSION =
"0.0.5"

Class Method Summary collapse

Class Method Details

.error_type(status) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/fake_sns/error.rb', line 6

def self.error_type(status)
  Class.new(Error) do
    define_method :status do
      status
    end
  end
end

.server(options) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fake_sns.rb', line 34

def self.server(options)
  app = Server
  if log = options[:log]
    $stdout.reopen(log, "w:utf-8")
    $stderr.reopen(log, "w:utf-8")
    app.enable :logging
  end
  if options[:verbose]
    require "fake_sns/show_output"
    app.use FakeSNS::ShowOutput
  end
  options.each do |key, value|
    app.set key, value
  end
  app
end