Class: WatirInstall::Generators::Test
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- WatirInstall::Generators::Test
- Includes:
- Thor::Actions
- Defined in:
- lib/watir_install/generators/test.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
14 15 16 |
# File 'lib/watir_install/generators/test.rb', line 14 def self.source_root "#{File.dirname(__FILE__)}/tests" end |
Instance Method Details
#data_files ⇒ Object
26 27 28 29 30 31 |
# File 'lib/watir_install/generators/test.rb', line 26 def data_files file = "#{Dir.pwd}/spec/#{klass.downcase}_spec.rb" erb = form == 'true' ? "crud" : "spec" template "spec/#{erb}.rb.tt", file @git.add(file) if @git end |
#git ⇒ Object
18 19 20 |
# File 'lib/watir_install/generators/test.rb', line 18 def git @git = Git.open('./') if Dir.entries('./').include?('.git') end |
#name ⇒ Object
22 23 24 |
# File 'lib/watir_install/generators/test.rb', line 22 def name Dir.pwd[/[^\/]*$/] end |