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.
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/8033594c-7d02-4dac-ab39-3df6977677b6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.