testgen 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,7 +1,10 @@
1
- === Version 0.3
1
+ === Version 0.4 / 2012-08-20
2
+ * Added support for gametel by using the --with-gametel option
3
+
4
+ === Version 0.3 / 2012-08-01
2
5
  * Fixed problem with not including source in generated Gemfile
3
6
 
4
- === Version 0.2.4
7
+ === Version 0.2.4 / 2011-10-28
5
8
  * Enhancements
6
9
  * added --with-lib option to store pages in a lib directory off the project root
7
10
 
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gem 'rake'
4
+ gem 'fuubar'
5
+ gem 'fuubar-cucumber'
6
+ gem 'growl'
7
+ gem 'guard-rspec'
8
+ gem 'guard-cucumber'
9
+
3
10
  # Specify your gem's dependencies in testgen.gemspec
4
11
  gemspec
data/Guardfile ADDED
@@ -0,0 +1,10 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'cucumber', :notification => true, :all_after_pass => true, :cli => '--profile focus' do
5
+ watch(%r{^features/.+\.feature$})
6
+ watch(%r{^features/support/.+$}) { 'features' }
7
+ watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
8
+ watch(%r{^lib/.+\.rb$}) { "features" }
9
+ watch(%r{^cucumber.yml$}) { "features" }
10
+ end
data/cucumber.yml CHANGED
@@ -1,2 +1,3 @@
1
1
  default: --no-source --color --format pretty
2
- autotest: --no-source --color --format pretty
2
+ focus: --no-source --color --format pretty --tags @focus
3
+
@@ -0,0 +1,25 @@
1
+ Feature: Adding the --with-gametel flag
2
+
3
+ Scenario: Adding the require_all and gametel gems to Gemfile
4
+ When I run `testgen project sample --with-gametel`
5
+ Then a file named "sample/Gemfile" should exist
6
+ And the file "sample/Gemfile" should contain "gem 'require_all'"
7
+ And the file "sample/Gemfile" should contain "gem 'gametel'"
8
+
9
+ Scenario: Adding page-object to env.rb
10
+ When I run `testgen project sample --with-gametel`
11
+ Then a file named "sample/features/support/env.rb" should exist
12
+ And the file "sample/features/support/env.rb" should contain "require 'gametel'"
13
+ And the file "sample/features/support/env.rb" should contain "World(Gametel::Navigation)"
14
+
15
+ Scenario: Should not create the hooks file
16
+ When I run `testgen project sample --with-gametel`
17
+ Then a file named "sample/features/support/hooks.rb" should not exist
18
+
19
+ Scenario: Creating the pages directory under support
20
+ When I run `testgen project sample --with-gametel`
21
+ Then a directory named "sample/features/support/screens" should exist
22
+
23
+ Scenario: Creating the pages directory under lib when using --wth-lib
24
+ When I run `testgen project sample --with-gametel --with-lib`
25
+ Then a directory named "sample/lib/screens" should exist
data/lib/testgen/cli.rb CHANGED
@@ -7,11 +7,13 @@ module TestGen
7
7
  desc "project <project_name>", "Create a new test project"
8
8
  method_option :pageobject_driver, :type => :string, :required => false, :desc => "Use the PageObject gem to drive browsers. Valid values are 'watir' and 'selenium'"
9
9
  method_option :with_lib, :type => :boolean, :desc => "Place shared objects under lib directory"
10
+ method_option :with_gametel, :type => :boolean, :desc => "Add support for gametel gem"
10
11
  def project(name)
11
12
  driver = options[:pageobject_driver].nil? ? 'none' : options[:pageobject_driver]
12
- with_lib = options[:with_lib] == true ? 'true' : 'false'
13
- TestGen::Generators::Project.start([name, driver, with_lib])
13
+ with_lib = options[:with_lib] ? 'true' : 'false'
14
+ with_gametel = options[:with_gametel] ? 'true' : 'false'
15
+ TestGen::Generators::Project.start([name, driver, with_lib, with_gametel])
14
16
  end
15
17
 
16
18
  end
17
- end
19
+ end
@@ -9,6 +9,7 @@ module TestGen
9
9
  argument :name, :type => :string, :desc => 'The name of the project'
10
10
  argument :pageobject_driver, :type => :string, :desc => 'Driver to use with PageObject'
11
11
  argument :with_lib, :type => :string, :desc => 'Place all shared objects in the lib directory'
12
+ argument :with_gametel, :type => :string, :desc => 'Add support for the gametel gem'
12
13
  desc "Generates a project structure for testing with Cucumber"
13
14
 
14
15
  def self.source_root
@@ -52,8 +53,10 @@ module TestGen
52
53
  def create_pages_directory
53
54
  if gen_lib
54
55
  empty_directory("#{name}/lib/pages") unless no_driver_selected
56
+ empty_directory("#{name}/lib/screens") if with_gametel == 'true'
55
57
  else
56
58
  empty_directory("#{name}/features/support/pages") unless no_driver_selected
59
+ empty_directory("#{name}/features/support/screens") if with_gametel == 'true'
57
60
  end
58
61
  end
59
62
 
@@ -68,4 +71,4 @@ module TestGen
68
71
  end
69
72
  end
70
73
  end
71
- end
74
+ end
@@ -5,7 +5,10 @@ gem 'rspec'
5
5
  <% unless pageobject_driver.downcase == 'none' -%>
6
6
  gem 'page-object'
7
7
  <% end -%>
8
- <% if with_lib == 'true' -%>
8
+ <% if with_lib == 'true' or with_gametel == 'true' -%>
9
9
  gem 'require_all'
10
10
  <% end -%>
11
+ <% if with_gametel == 'true' -%>
12
+ gem 'gametel'
13
+ <% end -%>
11
14
 
@@ -6,14 +6,19 @@ require 'rspec-expectations'
6
6
  <% unless pageobject_driver.downcase == 'none' -%>
7
7
  require 'page-object'
8
8
  require 'page-object/page_factory'
9
- <% end %>
9
+ <% end -%>
10
10
  <% if with_lib == 'true' -%>
11
11
  require 'require_all'
12
12
 
13
13
  require_all 'lib'
14
14
  <% end -%>
15
15
 
16
+ <% if with_gametel == 'true' -%>
17
+ require 'gametel'
18
+
19
+ World(Gametel::Navigation)
20
+ <% end -%>
16
21
 
17
22
  <% unless pageobject_driver.downcase == 'none' -%>
18
23
  World(PageObject::PageFactory)
19
- <% end %>
24
+ <% end -%>
@@ -1,3 +1,3 @@
1
1
  module TestGen
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
data/testgen.gemspec CHANGED
@@ -18,9 +18,9 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency 'thor', '>=0.14.6'
22
- s.add_dependency 'cucumber', '>=1.0.0'
23
- s.add_dependency 'rspec', '>=2.6.0'
21
+ s.add_dependency 'thor', '>=0.16.0'
22
+ s.add_dependency 'cucumber', '>=1.2.0'
23
+ s.add_dependency 'rspec', '>=2.11.0'
24
24
  s.add_dependency 'sys-uname'
25
25
  s.add_dependency 'require_all'
26
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testgen
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-01 00:00:00.000000000 Z
12
+ date: 2012-08-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.14.6
21
+ version: 0.16.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.14.6
29
+ version: 0.16.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: cucumber
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 1.0.0
37
+ version: 1.2.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 1.0.0
45
+ version: 1.2.0
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rspec
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.6.0
53
+ version: 2.11.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.6.0
61
+ version: 2.11.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: sys-uname
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -119,6 +119,7 @@ files:
119
119
  - .rvmrc
120
120
  - ChangeLog
121
121
  - Gemfile
122
+ - Guardfile
122
123
  - Rakefile
123
124
  - Readme.md
124
125
  - bin/testgen
@@ -127,6 +128,7 @@ files:
127
128
  - features/support/hooks.rb
128
129
  - features/testgen_project.feature
129
130
  - features/testgen_with_pageobject.feature
131
+ - features/with_gametel_option.feature
130
132
  - features/with_lib_option.feature
131
133
  - lib/testgen.rb
132
134
  - lib/testgen/cli.rb
@@ -150,12 +152,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
152
  - - ! '>='
151
153
  - !ruby/object:Gem::Version
152
154
  version: '0'
155
+ segments:
156
+ - 0
157
+ hash: 1677098905194904714
153
158
  required_rubygems_version: !ruby/object:Gem::Requirement
154
159
  none: false
155
160
  requirements:
156
161
  - - ! '>='
157
162
  - !ruby/object:Gem::Version
158
163
  version: '0'
164
+ segments:
165
+ - 0
166
+ hash: 1677098905194904714
159
167
  requirements: []
160
168
  rubyforge_project: testgen
161
169
  rubygems_version: 1.8.24
@@ -167,4 +175,5 @@ test_files:
167
175
  - features/support/hooks.rb
168
176
  - features/testgen_project.feature
169
177
  - features/testgen_with_pageobject.feature
178
+ - features/with_gametel_option.feature
170
179
  - features/with_lib_option.feature