Class: Testinator

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/testinator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



22
23
24
# File 'lib/testinator.rb', line 22

def self.source_root
  File.expand_path(File.join(File.dirname(__FILE__), "..", "template"))
end

Instance Method Details

#setup(name, path = ".") ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/testinator.rb', line 10

def setup(name,path=".")
  @app = Config.new
  @app.name = name
  self.destination_root = File.expand_path(File.join(Dir.pwd,path))
  copy_file 'Gemfile'
  empty_directory 'spec'
  template 'default_spec.rb.erb', 'spec/default_spec.rb'
  inside(self.destination_root) do
    run('bundle install')
  end
end