Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
* Use correct to_source api
* Use toplevel mutant.
  • Loading branch information
Markus Schirp committed Aug 20, 2012
1 parent ba68e17 commit 21b6aa1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/integration/mutant/zombie_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
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
11 changes: 2 additions & 9 deletions spec/support/zombie.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -59,7 +52,7 @@ def self.zombify(root, path)
# 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

Expand Down

0 comments on commit 21b6aa1

Please sign in to comment.