Browse files

Reorganized sample login feature files. Disregard installed merb_cucu…

…mber gem for running tests.
  • Loading branch information...
1 parent 1cbada4 commit 7d495457ea64d041594efe8d14e63e413d88cf1c @david committed Dec 17, 2008
View
4 lib/generators/cucumber.rb
@@ -18,9 +18,9 @@ def self.source_root
template(:autotest) { |t| t.source = t.destination = "autotest/cucumber_merb_rspec.rb" }
template(:result_steps) { |t| t.source = t.destination = "features/steps/result_steps.rb" }
- template(:example_feature, :session_type => :webrat) { |t| t.source = t.destination = "features/login.feature" }
+ template(:example_feature, :session_type => :webrat) { |t| t.source = t.destination = "features/authentication/login.feature" }
template(:example_feature_steps, :session_type => :webrat) do |t|
- t.source = t.destination = "features/steps/login_steps.rb"
+ t.source = t.destination = "features/authentication/steps/login_steps.rb"
end
template(:webrat_steps, :session_type => :webrat) do |t|
t.source = t.destination = "features/steps/webrat_steps.rb"
View
0 ...cucumber/templates/features/login.feature → ...tes/features/authentication/login.feature
File renamed without changes.
View
0 ...r/templates/features/steps/login_steps.rb → ...tures/authentication/steps/login_steps.rb
File renamed without changes.
View
21 spec/cucumber_setup_generator_spec.rb
@@ -1,4 +1,5 @@
require File.dirname(__FILE__) + '/spec_helper'
+require File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'cucumber')
describe "common files generator", :shared => true do
@@ -67,11 +68,15 @@
it_should_behave_like "common files generator"
- it "should not generate the features/login.feature file" do
- @generator.should_not create('/tmp/features/login.feature')
+ it "should not generate the features/authentication/login.feature file" do
+ @generator.should_not create('/tmp/features/authentication/login.feature')
end
- it "should not generate the features/steps/common_webrat.rb file" do
+ it "should not generate the features/authentication/steps/login_steps.rb file" do
+ @generator.should_not create('/tmp/features/authentication/steps/login_steps.rb')
+ end
+
+ it "should not generate the features/steps/webrat_steps.rb file" do
@generator.should_not create('/tmp/features/steps/webrat_steps.rb')
end
@@ -87,11 +92,15 @@
it_should_behave_like "common files generator"
- it "should generate the features/login.feature file" do
- @generator.should create('/tmp/features/login.feature')
+ it "should generate the features/authentication/login.feature file" do
+ @generator.should create('/tmp/features/authentication/login.feature')
+ end
+
+ it "should generate the features/authentication/steps/login_steps.rb file" do
+ @generator.should create('/tmp/features/authentication/steps/login_steps.rb')
end
- it "should generate the features/steps/common_webrat.rb file" do
+ it "should generate the features/steps/webrat_steps.rb file" do
@generator.should create('/tmp/features/steps/webrat_steps.rb')
end
View
4 spec/feature_generator_spec.rb
@@ -1,5 +1,5 @@
require File.dirname(__FILE__) + '/spec_helper'
-
+require File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'feature')
def underscored_file_name(name)
name.gsub(/\s+/, "_")
@@ -59,4 +59,4 @@ def underscored_file_name(name)
@generator.should create("/tmp/features/steps/#{underscored_file_name(@name)}_steps.rb")
end
end
-end
+end
View
6 spec/spec_helper.rb
@@ -1,13 +1,11 @@
require 'rubygems'
require 'spec'
-require 'merb-core'
require 'merb-gen'
+$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+
require 'templater/spec/helpers'
-__dir__ = File.dirname(__FILE__)
-require File.join(__dir__, "..", "lib", "generators", "cucumber")
-require File.join(__dir__, "..", "lib", "generators", "feature")
Merb.disable(:initfile)
Spec::Runner.configure do |config|

0 comments on commit 7d49545

Please sign in to comment.