Skip to content

Commit

Permalink
remove implementation details
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed May 15, 2015
1 parent 77c82b3 commit f2fc11e
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions core/module/autoload_spec.rb
Expand Up @@ -443,32 +443,6 @@ class ModuleSpecs::Autoload::Z < ModuleSpecs::Autoload::ZZ
end

describe "Module#autoload" do
# It would be nice to check this with a simple obj.should_not_receive,
# but getting at that obj is implementation specific. This method is the
# least implementation specific because it inserts the method that raises
# an exception into the dynamic lookup chain.
before :all do
module Kernel
alias_method :original_require, :require
alias_method :original_load, :load

def require(name)
raise Exception, "Kernel#require called"
end

def load(name)
raise Exception, "Kernel#load called"
end
end
end

after :all do
module Kernel
alias_method :require, :original_require
alias_method :load, :original_load
end
end

it "does not call Kernel#require or Kernel#load dynamically" do
ModuleSpecs::Autoload.autoload :N, fixture(__FILE__, "autoload_n.rb")
ModuleSpecs::Autoload::N.should == :autoload_n
Expand Down

0 comments on commit f2fc11e

Please sign in to comment.