Skip to content

Commit

Permalink
Warn when Pusher configuration is not set.
Browse files Browse the repository at this point in the history
Fixes #43.
  • Loading branch information
tristandunn committed May 22, 2015
1 parent ffcd3b6 commit 66cbf8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

* Warn when Pusher configuration is not set. (Tristan Dunn)

## 1.4.0 — May 20th, 2015

* Update development and test dependencies. (Tristan Dunn)
Expand Down
12 changes: 12 additions & 0 deletions lib/pusher-fake/support/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
if Pusher.app_id.nil?
warn("Warning: `Pusher.app_id` is not set. Should be set before including PusherFake.")
end

if Pusher.key.nil?
warn("Warning: `Pusher.key` is not set. Should be set before including PusherFake.")
end

if Pusher.secret.nil?
warn("Warning: `Pusher.secret` is not set. Should be set before including PusherFake.")
end

# Use the same API key and secret as the live version.
PusherFake.configure do |configuration|
configuration.app_id = Pusher.app_id
Expand Down

0 comments on commit 66cbf8b

Please sign in to comment.