Class: CwTestGen::Generators::Project
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- CwTestGen::Generators::Project
- Includes:
- Thor::Actions
- Defined in:
- lib/cwtestgen/generators/project.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_cucumber_yml ⇒ Object
- #copy_env ⇒ Object
- #copy_hooks ⇒ Object
- #copy_page_templates ⇒ Object
- #create_cucumber_directories ⇒ Object
- #create_log_directory ⇒ Object
- #create_pages_directory ⇒ Object
- #create_screenshot_directory ⇒ Object
- #create_symlink_to_lib ⇒ Object
- #create_top_directory ⇒ Object
Class Method Details
.source_root ⇒ Object
13 14 15 |
# File 'lib/cwtestgen/generators/project.rb', line 13 def self.source_root File.dirname(__FILE__) + "/project" end |
Instance Method Details
#copy_cucumber_yml ⇒ Object
21 22 23 |
# File 'lib/cwtestgen/generators/project.rb', line 21 def copy_cucumber_yml template "cucumber.yml.tt", "#{name}/cucumber.yml" end |
#copy_env ⇒ Object
43 44 45 |
# File 'lib/cwtestgen/generators/project.rb', line 43 def copy_env template "env.rb.tt", "#{name}/features/support/env.rb" end |
#copy_hooks ⇒ Object
39 40 41 |
# File 'lib/cwtestgen/generators/project.rb', line 39 def copy_hooks template "hooks.rb.tt", "#{name}/features/support/hooks.rb" end |
#copy_page_templates ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/cwtestgen/generators/project.rb', line 51 def copy_page_templates if gen_page_templates template "clockwork_page.rb.tt", "#{name}/features/support/pages/clockwork_page.rb" template "home_page.rb.tt", "#{name}/features/support/pages/home_page.rb" template "sample_cucumber.feature.tt", "#{name}/features/sample_cucumber.feature" template "sample_steps.rb.tt", "#{name}/features/support/step_definitions/#{name}_steps.rb" end end |
#create_cucumber_directories ⇒ Object
25 26 27 28 29 |
# File 'lib/cwtestgen/generators/project.rb', line 25 def create_cucumber_directories empty_directory("#{name}/features") empty_directory("#{name}/features/support") empty_directory("#{name}/features/step_definitions") end |
#create_log_directory ⇒ Object
31 32 33 |
# File 'lib/cwtestgen/generators/project.rb', line 31 def create_log_directory empty_directory("#{name}/features/logs") end |
#create_pages_directory ⇒ Object
47 48 49 |
# File 'lib/cwtestgen/generators/project.rb', line 47 def create_pages_directory empty_directory("#{name}/features/support/pages") end |
#create_screenshot_directory ⇒ Object
35 36 37 |
# File 'lib/cwtestgen/generators/project.rb', line 35 def create_screenshot_directory empty_directory("#{name}/features/screenshots") end |
#create_symlink_to_lib ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/cwtestgen/generators/project.rb', line 60 def create_symlink_to_lib if gen_symlink_to_lib if File.symlink?("#{name}/features/support/lib") return nil end if File.directory?("../lib") File.symlink("../../../../lib","#{name}/features/support/lib") end end end |
#create_top_directory ⇒ Object
17 18 19 |
# File 'lib/cwtestgen/generators/project.rb', line 17 def create_top_directory empty_directory(name) end |