wisper-rspec icon indicating copy to clipboard operation
wisper-rspec copied to clipboard

undefined local variable or method `publisher'

Open aaldrich opened this issue 5 years ago • 1 comments

I can't figure out how to get past this error. I've followed the instructions but I keep getting the error "undefined local variable or method `publisher'" whenever I run my specs.

I've added the following to my spec_helper.rb

RSpec::configure do |config|
  config.include(Wisper::RSpec::BroadcastMatcher)
end

In my test I've written a test like this

it "should broadcast a message for each integration type" do
  expect { publisher.execute }.to broadcast(:facebook_pixel_subscriber_created)
  SubscriberSubscriber.new.perform(@input_message)
end

I always get the error as shown here Screen Shot on 2020-05-17 at 01-02-24

Any ideas?

aaldrich avatar May 17 '20 06:05 aaldrich

I think publisher must be a class instance variable belongs to your publisher class.

oscarada87 avatar Oct 08 '20 08:10 oscarada87

This doesn't look to be related to wisper-rspec.

krisleech avatar Apr 13 '23 16:04 krisleech