On Apr 23, 2011, at 10:40 AM, Matthew Van Horn wrote: > def self.nullify_contextually?(other) > rspec_root = defined?(RSpec) ? RSpec : Spec > if defined? rspec_root::Rails::RailsExampleGroup > other.ancestors.include?(rspec_root::Rails::RailsExampleGroup) > else > other.ancestors.include?(rspec_root::Rails::ModelExampleGroup) || > other.ancestors.include?(rspec_root::Rails::ControllerExampleGroup) || > other.ancestors.include?(rspec_root::Rails::ViewExampleGroup) || > other.ancestors.include?(rspec_root::Rails::HelperExampleGroup) > end > end
Changing 'ancestors' to 'included_modules' seems to make this work for me. ancestors is returning a one-element array with an anonymous class in it. included_modules is returning what I'd expect [NullDB::RSpec::NullifiedDatabase, RSpec::Rails::ModelExampleGroup, RSpec::Rails::RailsExampleGroup... etc] Could this be a ruby version thing? I'm using ree 1.8.7 for the moment. -- matt
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users