{"action":"created","issue":{"url":"https://api.github.com/repos/krisleech/wisper/issues/109","labels_url":"https://api.github.com/repos/krisleech/wisper/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/krisleech/wisper/issues/109/comments","events_url":"https://api.github.com/repos/krisleech/wisper/issues/109/events","html_url":"https://github.com/krisleech/wisper/pull/109","id":72691597,"number":109,"title":"Test harness","user":{"login":"RobinDaugherty","id":1005280,"avatar_url":"https://avatars.githubusercontent.com/u/1005280?v=3","gravatar_id":"","url":"https://api.github.com/users/RobinDaugherty","html_url":"https://github.com/RobinDaugherty","followers_url":"https://api.github.com/users/RobinDaugherty/followers","following_url":"https://api.github.com/users/RobinDaugherty/following{/other_user}","gists_url":"https://api.github.com/users/RobinDaugherty/gists{/gist_id}","starred_url":"https://api.github.com/users/RobinDaugherty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobinDaugherty/subscriptions","organizations_url":"https://api.github.com/users/RobinDaugherty/orgs","repos_url":"https://api.github.com/users/RobinDaugherty/repos","events_url":"https://api.github.com/users/RobinDaugherty/events{/privacy}","received_events_url":"https://api.github.com/users/RobinDaugherty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-02T20:10:51Z","updated_at":"2015-12-15T14:45:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/krisleech/wisper/pulls/109","html_url":"https://github.com/krisleech/wisper/pull/109","diff_url":"https://github.com/krisleech/wisper/pull/109.diff","patch_url":"https://github.com/krisleech/wisper/pull/109.patch"},"body":"Add a test harness which allows us to use Wisper in a project with extensive specs. This is modeled after [Sidekiq::Testing](https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/testing.rb). It modifies the `Wisper` and `Wisper::Publisher` modules to allow the following:\r\n\r\n1. Testing whether subscriptions exist.\r\n2. Running actions in a project that publish events, but without necessarily delivering the events.\r\n\r\nIn order to use this, a project's tests (e.g. `spec_helper`) will need to include the testing module:\r\n\r\n```ruby\r\nrequire 'wisper/testing'\r\n```\r\n\r\nThe `Wisper::Testing` module and its use are described in the README. The default mode of the testing module is to change no functionality. \"Fake\" mode is enabled by calling `Wisper::Testing.fake!`. If called with a block, the mode change is only effective during the block's execution.\r\n\r\nWe wouldn't want the Wisper classes/modules to be polluted by the testing module, so 'wisper/testing' is not included during normal operation. So I did not modify the existing specs by including 'wisper/testing'.\r\n\r\nIn order to ensure that this new module works correctly and doesn't break the existing Wisper functionality, it would be necessary to run the spec suite twice: one with Wisper::Testing and one without. The default behavior is to run without, which can be changed by setting the `INCLUDE_WISPER_TESTING` environment variable. Therefore it would be best to have CI run the spec twice, the second time with that variable set.\r\n\r\nUnfortunately, this would cause the test coverage to be wrong and/or reported twice per build. I think it might be best to only run the specs a single time and allow the testing module to be included randomly based on rspec's seed. This seems to be how the sidekiq project does it, but they're using Minitest, so it's not clear to me whether it works exactly the same."},"comment":{"url":"https://api.github.com/repos/krisleech/wisper/issues/comments/164784786","html_url":"https://github.com/krisleech/wisper/pull/109#issuecomment-164784786","issue_url":"https://api.github.com/repos/krisleech/wisper/issues/109","id":164784786,"user":{"login":"maokomioko","id":767496,"avatar_url":"https://avatars.githubusercontent.com/u/767496?v=3","gravatar_id":"","url":"https://api.github.com/users/maokomioko","html_url":"https://github.com/maokomioko","followers_url":"https://api.github.com/users/maokomioko/followers","following_url":"https://api.github.com/users/maokomioko/following{/other_user}","gists_url":"https://api.github.com/users/maokomioko/gists{/gist_id}","starred_url":"https://api.github.com/users/maokomioko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maokomioko/subscriptions","organizations_url":"https://api.github.com/users/maokomioko/orgs","repos_url":"https://api.github.com/users/maokomioko/repos","events_url":"https://api.github.com/users/maokomioko/events{/privacy}","received_events_url":"https://api.github.com/users/maokomioko/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T14:45:28Z","updated_at":"2015-12-15T14:45:28Z","body":"Any update on this?"}}