An example of using pusher-fake with RSpec to test a Rails application.
<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>
require "pusher-fake/support/rspec"
pusher-fake-example uses the MIT license. See LICENSE for more details.