-
Notifications
You must be signed in to change notification settings - Fork 8
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
Clarity around using a construct in a before block for rspec #5
Comments
@programingnotes Thanks for using this gem! Sorry you're running into issues. Can you post the source of the spec that is failing? |
@bhb thanks for getting back to me. By the source, I take it you mean the method being tested? If so then the pseudo code is pasted below:
|
Sorry, I should have been clearer: can you post your spec code in its entirety? The spec code in your original message appears to only be a section of the spec file. In particular, I'd be curious to see the full code that yielded the |
@programingnotes Actually, I can reproduce the issue the RSpec integration. Sorry about that - not sure if it was always buggy or if some change in RSpec broke this. I haven't used this project in awhile (and I don't usually use RSpec in my projects), so it may have always had an issue - although it's weird the tests pass in this project. In any case, it looks like the example as provided doesn't work with the modern version of RSpec - PRs are welcome to update the integration 😄 Of course, you could always setup/teardown construct manually in require_relative 'file_creator'
require "test_construct/rspec_integration"
describe '#create_domain_dir' do
let(:domain_name) { "example.com" }
let(:file_creator) { FileCreator.new }
before do
@c = setup_construct
end
after do
teardown_construct(@c)
end
it 'works if directory does not exist' do
file_creator.create_domain_dir(domain_name)
end
it 'works if dir does exist' do
@c.directory "intel/job/analysis/example.com"
file_creator.create_domain_dir(domain_name)
end
end |
Just wanted to highlight that I'd still welcome PRs for this |
See #11 for a version of the example which works with a modern version of RSpec. |
hi @bhb I am currently experiencing a situation similar to that discussed in this issue
the feedback in the issue referred to suggests to " use the RSpec integration and make calls in
your setup block" but doing this results in an error:
I have looked through rspec_integration but can't seem to figure out how to accomplish keeping the construct around till my example block runs.
Would appreciate feedback please. thank you!
The text was updated successfully, but these errors were encountered: