I have a shared context in the /spec/support directory. This is called for every example now, not only for those which include it. Is there something special about the support directory and where should I place it if I don’t want to run it on every example?
Here is the context-file:
require 'spec_helper'
shared_context "timeout context", :timeout do
around(:each) do |example|
timeout = example.metadata[:timeout] || 1.second
Rails.logger.debug "timeout #{timeout} sec for: #{example.metadata[:example_group][:file_path].gsub(/.*?\/spec\//, '')}"
Timeout::timeout(timeout) {
example.run
}
end
end
Is this issue maybe related to the around(:each)?
Seems a little bit like the around block is the culprit, so I added the following to a file in the folder /rspec/support/:
and call my specs now with: