merb_cucumber 0.5.1.2 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/Rakefile +12 -50
- data/lib/generators/cucumber.rb +3 -3
- data/lib/generators/cucumber/templates/config/cucumber.yml +1 -0
- data/lib/generators/cucumber/templates/features/support/env.rb +7 -7
- data/lib/generators/cucumber/templates/lib/tasks/cucumber.rake +33 -28
- data/lib/merb_cucumber/version.rb +5 -0
- data/lib/merb_cucumber/world/webrat.rb +1 -1
- data/spec/cucumber_setup_generator_spec.rb +4 -4
- data/spec/spec_helper.rb +5 -3
- metadata +94 -24
- data/lib/generators/cucumber/templates/cucumber.yml +0 -1
data/README.textile
CHANGED
@@ -10,7 +10,7 @@ merb_cucumber 0.5.0 now requires a version greater than cucumber 0.1.13, which i
|
|
10
10
|
|
11
11
|
Cucumber::CLI.execute ARGV
|
12
12
|
|
13
|
-
* Add a cucumber.yml to your Merb.root with the following contents:
|
13
|
+
* Add a config/cucumber.yml to your Merb.root with the following contents:
|
14
14
|
|
15
15
|
default: --format pretty features
|
16
16
|
|
data/Rakefile
CHANGED
@@ -1,55 +1,17 @@
|
|
1
|
-
require '
|
2
|
-
require 'rake/gempackagetask'
|
1
|
+
require 'rake'
|
3
2
|
|
4
|
-
require '
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
AUTHOR = ["Roman Gonzalez", "David Leal"]
|
10
|
-
EMAIL = ["romanandreg@gmail.com", "dgleal@gmail.com"]
|
11
|
-
HOMEPAGE = "http://github.com/david/merb_cucumber"
|
12
|
-
SUMMARY = "Cucumber integration for Merb"
|
13
|
-
|
14
|
-
spec = Gem::Specification.new do |s|
|
15
|
-
s.rubyforge_project = 'merb'
|
16
|
-
s.name = GEM_NAME
|
17
|
-
s.version = GEM_VERSION
|
18
|
-
s.platform = Gem::Platform::RUBY
|
19
|
-
s.has_rdoc = true
|
20
|
-
s.extra_rdoc_files = ["README.textile", "LICENSE", 'TODO']
|
21
|
-
s.summary = SUMMARY
|
22
|
-
s.description = s.summary
|
23
|
-
s.authors = AUTHOR
|
24
|
-
s.email = EMAIL
|
25
|
-
s.homepage = HOMEPAGE
|
26
|
-
s.add_dependency('merb-core', '~> 1.0')
|
27
|
-
s.add_dependency('cucumber', '>= 0.1.14')
|
28
|
-
s.require_path = 'lib'
|
29
|
-
s.files = %w(LICENSE README.textile Rakefile TODO Generators) + Dir.glob("{lib,spec}/**/*")
|
30
|
-
end
|
31
|
-
|
32
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
33
|
-
pkg.gem_spec = spec
|
34
|
-
end
|
35
|
-
|
36
|
-
desc "install the plugin as a gem"
|
37
|
-
task :install do
|
38
|
-
Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
|
39
|
-
end
|
40
|
-
|
41
|
-
desc "Uninstall the gem"
|
42
|
-
task :uninstall do
|
43
|
-
Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
|
3
|
+
require 'spec/rake/spectask'
|
4
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
5
|
+
spec.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
|
6
|
+
spec.libs << 'lib' << 'spec'
|
7
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
44
8
|
end
|
45
9
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
10
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
11
|
+
spec.libs << 'lib' << 'spec'
|
12
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
13
|
+
spec.rcov = true
|
51
14
|
end
|
52
15
|
|
53
|
-
|
54
|
-
|
55
|
-
require 'merb-core/test/tasks/spectasks'
|
16
|
+
desc 'Default: run spec examples'
|
17
|
+
task :default => 'spec'
|
data/lib/generators/cucumber.rb
CHANGED
@@ -9,9 +9,9 @@ module Merb::Generators
|
|
9
9
|
def self.source_root
|
10
10
|
File.join(File.dirname(__FILE__), 'cucumber', 'templates')
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
option :orm, :desc => 'Object-Relation Mapper to use (one of: none, activerecord, datamapper, sequel)'
|
14
|
-
option :session_type, :default => :
|
14
|
+
option :session_type, :default => :webrat, :desc => 'Session type to use (one of: simple, webrat)'
|
15
15
|
|
16
16
|
template(:env) { |t| t.source = t.destination = "features/support/env.rb" }
|
17
17
|
template(:rake) { |t| t.source = t.destination = "lib/tasks/cucumber.rake" }
|
@@ -25,7 +25,7 @@ module Merb::Generators
|
|
25
25
|
template(:webrat_steps, :session_type => :webrat) do |t|
|
26
26
|
t.source = t.destination = "features/steps/webrat_steps.rb"
|
27
27
|
end
|
28
|
-
template(:cucumber_yml) { |t| t.source = t.destination = "cucumber.yml" }
|
28
|
+
template(:cucumber_yml) { |t| t.source = t.destination = "config/cucumber.yml" }
|
29
29
|
|
30
30
|
def chmod(action)
|
31
31
|
File.chmod(0755, action.destination)
|
@@ -0,0 +1 @@
|
|
1
|
+
default: -r features/support --format pretty features
|
@@ -1,12 +1,6 @@
|
|
1
1
|
# Sets up the Merb environment for Cucumber (thanks to krzys and roman)
|
2
2
|
require "rubygems"
|
3
3
|
|
4
|
-
# Add the local gems dir if found within the app root; any dependencies loaded
|
5
|
-
# hereafter will try to load from the local gems before loading system gems.
|
6
|
-
if (local_gem_dir = File.join(File.dirname(__FILE__), '..', 'gems')) && $BUNDLE.nil?
|
7
|
-
$BUNDLE = true; Gem.clear_paths; Gem.path.unshift(local_gem_dir)
|
8
|
-
end
|
9
|
-
|
10
4
|
require "merb-core"
|
11
5
|
require 'spec/expectations'
|
12
6
|
require "merb_cucumber/world/<%= session_type %>"
|
@@ -16,6 +10,9 @@ require "merb_cucumber/helpers/datamapper"
|
|
16
10
|
require "merb_cucumber/helpers/activerecord"
|
17
11
|
<% end -%>
|
18
12
|
|
13
|
+
# Recursively Load all steps defined within features/**/*_steps.rb
|
14
|
+
Dir["#{Merb.root}" / "features" / "**" / "*_steps.rb"].each { |f| require f }
|
15
|
+
|
19
16
|
# Uncomment if you want transactional fixtures
|
20
17
|
# Merb::Test::World::Base.use_transactional_fixtures
|
21
18
|
|
@@ -24,4 +21,7 @@ require "merb_cucumber/helpers/activerecord"
|
|
24
21
|
def Spec.run? ; true; end
|
25
22
|
|
26
23
|
Merb.start_environment(:testing => true, :adapter => 'runner', :environment => ENV['MERB_ENV'] || 'test')
|
27
|
-
|
24
|
+
|
25
|
+
<% if orm == :datamapper -%>
|
26
|
+
DataMapper.auto_migrate!
|
27
|
+
<% end -%>
|
@@ -1,33 +1,38 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'cucumber/rake/task'
|
2
3
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
# Use vendored cucumber binary if possible. If it's not vendored,
|
5
|
+
# Cucumber::Rake::Task will automatically use installed gem's cucumber binary
|
6
|
+
vendored_cucumber_binary = Merb.root / 'bin' / 'cucumber' if File.exist?(Merb.root / 'bin' / 'cucumber')
|
7
|
+
|
8
|
+
namespace :cucumber do
|
9
|
+
Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t|
|
10
|
+
t.binary = vendored_cucumber_binary if vendored_cucumber_binary
|
11
|
+
t.fork = true # You may get faster startup if you set this to false
|
12
|
+
t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
13
|
+
end
|
8
14
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
t.cucumber_opts << step_file
|
15
|
-
end
|
16
|
-
end
|
15
|
+
Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t|
|
16
|
+
t.binary = vendored_cucumber_binary if vendored_cucumber_binary
|
17
|
+
t.fork = true # You may get faster startup if you set this to false
|
18
|
+
t.cucumber_opts = "--color --tags @wip:2 --wip --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
|
19
|
+
end
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
namespace :merb_cucumber do
|
21
|
-
task :test_env do
|
22
|
-
Merb.start_environment(:environment => "test", :adapter => 'runner')
|
21
|
+
desc 'Run all features'
|
22
|
+
task :all => [:ok, :wip]
|
23
23
|
end
|
24
|
-
|
24
|
+
desc 'Alias for cucumber:ok'
|
25
|
+
task :cucumber => 'cucumber:ok'
|
26
|
+
|
27
|
+
task :default => :cucumber
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
task
|
32
|
-
task :
|
33
|
-
|
29
|
+
task :features => :cucumber do
|
30
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
31
|
+
end
|
32
|
+
|
33
|
+
rescue LoadError
|
34
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
35
|
+
task :cucumber do
|
36
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
37
|
+
end
|
38
|
+
end
|
@@ -7,8 +7,8 @@ describe "common files generator", :shared => true do
|
|
7
7
|
@generator.should create('/tmp/features/support/env.rb')
|
8
8
|
end
|
9
9
|
|
10
|
-
it "should generate the cucumber.yml file" do
|
11
|
-
@generator.should create('/tmp/cucumber.yml')
|
10
|
+
it "should generate the config/cucumber.yml file" do
|
11
|
+
@generator.should create('/tmp/config/cucumber.yml')
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should generate the autotest/cucumber_merb_rspec.rb file" do
|
@@ -63,7 +63,7 @@ describe Merb::Generators::CucumberGenerator do
|
|
63
63
|
describe "on simple session" do
|
64
64
|
|
65
65
|
before(:each) do
|
66
|
-
@generator = Merb::Generators::CucumberGenerator.new('/tmp', {:orm => :datamapper})
|
66
|
+
@generator = Merb::Generators::CucumberGenerator.new('/tmp', {:orm => :datamapper, :session_type => :simple})
|
67
67
|
end
|
68
68
|
|
69
69
|
it_should_behave_like "common files generator"
|
@@ -87,7 +87,7 @@ describe Merb::Generators::CucumberGenerator do
|
|
87
87
|
describe "on webrat session" do
|
88
88
|
|
89
89
|
before(:each) do
|
90
|
-
@generator = Merb::Generators::CucumberGenerator.new('/tmp', {:orm => :datamapper
|
90
|
+
@generator = Merb::Generators::CucumberGenerator.new('/tmp', {:orm => :datamapper})
|
91
91
|
end
|
92
92
|
|
93
93
|
it_should_behave_like "common files generator"
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
|
2
|
+
|
3
|
+
# Use current merb-core sources if running from a typical dev checkout.
|
4
|
+
lib = File.expand_path('../../../merb/merb-core/lib', __FILE__)
|
5
|
+
$LOAD_PATH.unshift(lib) if File.directory?(lib)
|
6
|
+
require 'merb-core'
|
3
7
|
require 'merb-gen'
|
4
8
|
|
5
9
|
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -11,5 +15,3 @@ Merb.disable(:initfile)
|
|
11
15
|
Spec::Runner.configure do |config|
|
12
16
|
config.include Templater::Spec::Helpers
|
13
17
|
end
|
14
|
-
|
15
|
-
|
metadata
CHANGED
@@ -1,42 +1,105 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb_cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 5
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 6
|
9
|
+
- 1
|
10
|
+
version: 0.6.1
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Roman Gonzalez
|
8
14
|
- David Leal
|
15
|
+
- Jacques Crocker
|
9
16
|
autorequire:
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
19
|
|
13
|
-
date:
|
20
|
+
date: 2010-08-30 00:00:00 +01:00
|
14
21
|
default_executable:
|
15
22
|
dependencies:
|
16
23
|
- !ruby/object:Gem::Dependency
|
17
24
|
name: merb-core
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
hash: 19
|
32
|
+
segments:
|
33
|
+
- 1
|
34
|
+
- 1
|
35
|
+
- 0
|
36
|
+
version: 1.1.0
|
18
37
|
type: :runtime
|
19
|
-
|
20
|
-
|
38
|
+
version_requirements: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: merb-gen
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
21
44
|
requirements:
|
22
|
-
- -
|
45
|
+
- - ">="
|
23
46
|
- !ruby/object:Gem::Version
|
24
|
-
|
25
|
-
|
47
|
+
hash: 19
|
48
|
+
segments:
|
49
|
+
- 1
|
50
|
+
- 1
|
51
|
+
- 0
|
52
|
+
version: 1.1.0
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
26
55
|
- !ruby/object:Gem::Dependency
|
27
56
|
name: cucumber
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 7
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
- 7
|
67
|
+
- 2
|
68
|
+
version: 0.7.2
|
28
69
|
type: :runtime
|
29
|
-
|
30
|
-
|
70
|
+
version_requirements: *id003
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: cucumber-rails
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
31
76
|
requirements:
|
32
77
|
- - ">="
|
33
78
|
- !ruby/object:Gem::Version
|
34
|
-
|
35
|
-
|
79
|
+
hash: 3
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rspec
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 13
|
94
|
+
segments:
|
95
|
+
- 1
|
96
|
+
- 2
|
97
|
+
- 9
|
98
|
+
version: 1.2.9
|
99
|
+
type: :development
|
100
|
+
version_requirements: *id005
|
36
101
|
description: Cucumber integration for Merb
|
37
|
-
email:
|
38
|
-
- romanandreg@gmail.com
|
39
|
-
- dgleal@gmail.com
|
102
|
+
email: merbjedi@gmail.com
|
40
103
|
executables: []
|
41
104
|
|
42
105
|
extensions: []
|
@@ -46,13 +109,9 @@ extra_rdoc_files:
|
|
46
109
|
- LICENSE
|
47
110
|
- TODO
|
48
111
|
files:
|
49
|
-
- LICENSE
|
50
|
-
- README.textile
|
51
112
|
- Rakefile
|
52
|
-
- TODO
|
53
|
-
- Generators
|
54
113
|
- lib/generators/cucumber/templates/autotest/cucumber_merb_rspec.rb
|
55
|
-
- lib/generators/cucumber/templates/cucumber.yml
|
114
|
+
- lib/generators/cucumber/templates/config/cucumber.yml
|
56
115
|
- lib/generators/cucumber/templates/features/authentication/login.feature
|
57
116
|
- lib/generators/cucumber/templates/features/authentication/steps/login_steps.rb
|
58
117
|
- lib/generators/cucumber/templates/features/steps/result_steps.rb
|
@@ -65,6 +124,7 @@ files:
|
|
65
124
|
- lib/generators/feature.rb
|
66
125
|
- lib/merb_cucumber/helpers/activerecord.rb
|
67
126
|
- lib/merb_cucumber/helpers/datamapper.rb
|
127
|
+
- lib/merb_cucumber/version.rb
|
68
128
|
- lib/merb_cucumber/world/base.rb
|
69
129
|
- lib/merb_cucumber/world/simple.rb
|
70
130
|
- lib/merb_cucumber/world/webrat.rb
|
@@ -72,8 +132,12 @@ files:
|
|
72
132
|
- spec/cucumber_setup_generator_spec.rb
|
73
133
|
- spec/feature_generator_spec.rb
|
74
134
|
- spec/spec_helper.rb
|
135
|
+
- README.textile
|
136
|
+
- LICENSE
|
137
|
+
- TODO
|
138
|
+
- Generators
|
75
139
|
has_rdoc: true
|
76
|
-
homepage: http://github.com/
|
140
|
+
homepage: http://github.com/merb/merb_cucumber
|
77
141
|
licenses: []
|
78
142
|
|
79
143
|
post_install_message:
|
@@ -82,21 +146,27 @@ rdoc_options: []
|
|
82
146
|
require_paths:
|
83
147
|
- lib
|
84
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
85
150
|
requirements:
|
86
151
|
- - ">="
|
87
152
|
- !ruby/object:Gem::Version
|
153
|
+
hash: 3
|
154
|
+
segments:
|
155
|
+
- 0
|
88
156
|
version: "0"
|
89
|
-
version:
|
90
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
none: false
|
91
159
|
requirements:
|
92
160
|
- - ">="
|
93
161
|
- !ruby/object:Gem::Version
|
162
|
+
hash: 3
|
163
|
+
segments:
|
164
|
+
- 0
|
94
165
|
version: "0"
|
95
|
-
version:
|
96
166
|
requirements: []
|
97
167
|
|
98
|
-
rubyforge_project:
|
99
|
-
rubygems_version: 1.3.
|
168
|
+
rubyforge_project:
|
169
|
+
rubygems_version: 1.3.7
|
100
170
|
signing_key:
|
101
171
|
specification_version: 3
|
102
172
|
summary: Cucumber integration for Merb
|
@@ -1 +0,0 @@
|
|
1
|
-
default: -r features/steps -r features/support --format pretty features
|