I have tests that basically look like this:
module Foo
shared_examples_for "foo" do
it "works" do
true
end
end
describe "bar" do
it_behaves_like "foo"
end
end
The reason why the RSpec commands are inside "module Foo" is because my namespace name is very long ("PhusionPassenger"), and I want to avoid prepending the namespace name to every class I refer to. Since a recent RSpec version, I'm getting a "Accessing shared_examples defined across contexts is deprecated" warning. How do I avoid this warning while still avoiding prepending my namespace before every class reference?
I cannot just "include PhusionPassenger" in the global context. That will pollute the global namespace with all sorts of classes, potentially overwriting existing ones.