-
Notifications
You must be signed in to change notification settings - Fork 13
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
RSpec 3 Shared Examples Support #63
Comments
So this is because the described_class is overriden by Bogus and so doesn't match. I had to do this. RSpec.shared_examples "a term" do
let(:id) { "Creator" }
let(:resource) { resource_class.new(id) }
end
RSpec.describe Term do
verify_contract(:term)
it_behaves_like "a term" do
let(:resource_class) { Term }
end
end |
Thanks for reporting the issue. I just released version 0.1.6 which should have a fix for overwriting #described_class in RSpec 3.* (it was a problem I encountered in our integration tests). I'd really appreciate it, if you tried running your tests with updated bogus version and see if it fixed your issue as well. |
@psyho No go. The described_class didn't get overwritten. let(:resource_class) { described_class } didn't even work. |
That's a shame, I'll look into this in more detail then. Thanks for checking. |
I've spent some time debugging this issue today, and it looks like there's no reliable way to overwrite |
Not sure if this is specific to RSpec 3 - I'm trying to use Bogus and have two classes that have similar contracts (as one's a subclass of another). I'd normally put these in a shared example group and run those contract tests on both - but when I do that, Bogus doesn't pick up that the methods ran. Thoughts?
The text was updated successfully, but these errors were encountered: