Minor cleanups

* Use correct to_source api
* Use toplevel mutant.
This commit is contained in:
Markus Schirp 2012-08-20 04:50:07 +02:00
parent ba68e1799d
commit 21b6aa1e81
2 changed files with 3 additions and 10 deletions

View file

@ -3,6 +3,6 @@ require 'spec_helper'
describe Mutant, 'as a zombie' do
specify 'allows to create zombie from mutant' do
Zombie.setup
Zombie::Loader # constant created from zombie creation
Zombie::Runner
end
end

View file

@ -1,18 +1,11 @@
module Zombie
class Loader
module MethodObject
end
end
class Matcher
end
def self.setup
return if defined?(@done)
files.each do |path|
path = "#{File.expand_path(path, root)}.rb"
ast = File.read(path).to_ast
zombify(ast, path)
ToSource.to_source(ast.body)
end
@done = true
end
@ -59,7 +52,7 @@ module Zombie
# For some reason loading is not the same as eval...?
# eval(root.to_source)
Mutant::Loader.run(script)
::Mutant::Loader.run(script)
end
private_class_method :zombify