Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A fake Pusher server for development and testing.
Ruby HTML

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
features
lib
spec
.gitignore
.travis.yml
CHANGELOG.markdown
Gemfile
LICENSE
README.markdown
Rakefile
pusher-fake.gemspec

README.markdown

pusher-fake Build Status Dependency Status Code Climate Coverage Status

A fake Pusher server for development and testing.

Usage

1. Use the PusherFake JS for the Pusher JS instance.

<script>
  <% if defined?(PusherFake) %>
    // Test environment.
    //
    // Note: Ensure output is not HTML escaped, such as with the raw helper in Rails.
    var instance = <%= PusherFake.javascript %>;
  <% else %>
    // Other environments, such as production.
    var instance = new Pusher(...);
  <% end %>
</script>

2. Start PusherFake in Cucumber environment. If you aren't using Cucumber, see pusher-fake/cucumber.rb.

require "pusher-fake/cucumber"

Examples

  • pusher-fake-example - An example of using pusher-fake with Cucumber to test a Rails application.

Goal

Fully recreate the Pusher API service for development and testing.

Why?

  • Using a remote API for testing is slow.
  • Working offline is currently impossible.
  • Wasting connections and messages in development is unreasonable.
  • Stubbing the JavaScript, such as with pusher-test-stub, is suboptimal and tedious for integration tests.

License

pusher-fake uses the MIT license. See LICENSE for more details.

Something went wrong with that request. Please try again.