module RSpec::Rails::FixtureSupport::Fixtures
Public Instance Methods
Source
# File lib/rspec/rails/fixture_support.rb, line 36 def fixtures(*args) super.tap do fixture_sets.each_pair do |method_name, fixture_name| proxy_method_warning_if_called_in_before_context_scope(method_name, fixture_name) end end end
Calls superclass method
Source
# File lib/rspec/rails/fixture_support.rb, line 44 def proxy_method_warning_if_called_in_before_context_scope(method_name, fixture_name) define_method(method_name) do |*args, **kwargs, &blk| if RSpec.current_scope == :before_context_hook RSpec.warn_with("Calling fixture method in before :context ") else access_fixture(fixture_name, *args, **kwargs, &blk) end end end