Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `validate' for Promiscuous::Publisher:Module (NoMethodError) #71

Open
josephbridgwaterrowe opened this issue Mar 3, 2015 · 5 comments

Comments

@josephbridgwaterrowe
Copy link

I receive this error when using Promiscuous::Publisher.validate('generated_mocks.rb') in rails_helper.rb.

Maybe I'm missing something obvious but I tried searching the report for validate with no matching results.

Oh, and I'm using it with ActiveRecord.

@josephbridgwaterrowe
Copy link
Author

To be fair I'm not sure I even need this.

I was giving this a try because my database_cleaner.rb support file was failing, which I seem to have resolved by wrapping some of the statements with Promiscuous.without_promiscuous { }.

For example:

# spec/support/database_cleaner.rb
RSpec.configure do |config|
  config.before(:suite) do
    Promiscuous.without_promiscuous { DatabaseCleaner.clean_with(:truncation) }
  end

  config.before(:each) do
    DatabaseCleaner.strategy = :transaction
  end

  config.before(:each, :js => true) do
    DatabaseCleaner.strategy = :truncation
  end

  config.before(:each) do
    Promiscuous.without_promiscuous { DatabaseCleaner.start }
  end

  config.after(:each) do
    Promiscuous.without_promiscuous { DatabaseCleaner.clean }
  end
end

@kareemk
Copy link
Member

kareemk commented Mar 6, 2015

Validate isn't supported. This may be due to outdated documentation. Where did you see an example of this method being used?

@josephbridgwaterrowe
Copy link
Author

It was just in the documentation. When using the test mocks do we just include the generated mock file?

Thanks for your response.

@kareemk
Copy link
Member

kareemk commented Mar 8, 2015

Yes, exactly. You just include the mock file and then you can simulate publish events in your tests.

@josephbridgwaterrowe
Copy link
Author

OK, thanks for the verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants