steak 1.0.0.rc.1 → 1.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ s
@@ -0,0 +1,9 @@
1
+ class AcceptanceSpecGenerator < Rails::Generator::NamedBase
2
+ def manifest
3
+ record do |m|
4
+ m.directory File.join('spec/acceptance', class_path)
5
+ file_name.gsub!(/_spec$/,"")
6
+ m.template 'acceptance_spec.rb', File.join('spec/acceptance', class_path, "#{file_name}_spec.rb")
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ require File.dirname(__FILE__) + '/acceptance_helper'
2
+
3
+ feature "Feature name", %q{
4
+ In order to ...
5
+ As a ...
6
+ I want to ...
7
+ } do
8
+
9
+ scenario "Scenario name" do
10
+ true.should == true
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Sets up Steak in your Rails project. This will generate the spec/acceptance directory
3
+ and the necessary files.
4
+
5
+ If you haven't already, You should also run `./script/generate rspec` to complete the set up.
6
+
7
+ Examples:
8
+ `./script/generate steak`
@@ -0,0 +1,26 @@
1
+ class SteakGenerator < Rails::Generator::Base
2
+ default_options :driver => 'capybara'
3
+
4
+ def initialize(runtime_args, runtime_options = {})
5
+ puts "Defaulting to Capybara..." if runtime_args.empty?
6
+ super
7
+ end
8
+
9
+ def manifest
10
+ record do |m|
11
+ m.directory 'spec/acceptance/support'
12
+ m.directory 'lib/tasks'
13
+ m.template "acceptance_helper.rb", "spec/acceptance/acceptance_helper.rb"
14
+ m.file "helpers.rb", "spec/acceptance/support/helpers.rb"
15
+ m.file "paths.rb", "spec/acceptance/support/paths.rb"
16
+ m.file "steak.rake", "lib/tasks/steak.rake"
17
+ end
18
+ end
19
+
20
+ def add_options!(opt)
21
+ opt.separator ''
22
+ opt.separator 'Options:'
23
+ opt.on('--capybara', 'Use Capybara (default).') { |v| options[:driver] = 'capybara' }
24
+ opt.on('--webrat', 'Use Webrat.') { |v| options[:driver] = 'webrat' }
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ require File.dirname(__FILE__) + "/../spec_helper"
2
+ require "steak"
3
+ <%- if options[:driver] == 'webrat' %>
4
+ require "webrat"
5
+
6
+ Webrat.configure do |config|
7
+ config.mode = :rails
8
+ end
9
+ <%- else -%>
10
+ require 'capybara/rails'
11
+
12
+ Spec::Runner.configure do |config|
13
+ config.include Capybara
14
+ end
15
+ <%- end -%>
16
+
17
+ # Put your acceptance spec helpers inside /spec/acceptance/support
18
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -0,0 +1,5 @@
1
+ module HelperMethods
2
+ # Put helper methods you need to be available in all tests here.
3
+ end
4
+
5
+ Spec::Runner.configuration.include(HelperMethods)
@@ -0,0 +1,9 @@
1
+ module NavigationHelpers
2
+ # Put helper methods related to the paths in your application here.
3
+
4
+ def homepage
5
+ "/"
6
+ end
7
+ end
8
+
9
+ Spec::Runner.configuration.include(NavigationHelpers)
@@ -0,0 +1,19 @@
1
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
2
+
3
+ require 'spec/rake/spectask'
4
+
5
+ namespace :spec do
6
+ desc "Run the code examples in spec/acceptance"
7
+ Spec::Rake::SpecTask.new(:acceptance => "db:test:prepare") do |t|
8
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
9
+ t.spec_files = FileList["spec/acceptance/**/*_spec.rb"]
10
+ end
11
+
12
+ # Setup stats to include acceptance specs
13
+ task :statsetup do
14
+ require 'code_statistics'
15
+ ::STATS_DIRECTORIES << %w(Acceptance\ specs spec/acceptance) if File.exist?('spec/acceptance')
16
+ ::CodeStatistics::TEST_TYPES << "Acceptance specs" if File.exist?('spec/acceptance')
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steak
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424055
4
+ hash: 15424049
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - rc
11
- - 1
12
- version: 1.0.0.rc.1
11
+ - 2
12
+ version: 1.0.0.rc.2
13
13
  platform: ruby
14
14
  authors:
15
15
  - "Luismi Cavall\xC3\xA9"
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-10-12 00:00:00 +02:00
20
+ date: 2010-10-29 00:00:00 +02:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -141,6 +141,15 @@ files:
141
141
  - spec/acceptance/rspec-2/rails_spec.rb
142
142
  - spec/acceptance/rspec-2/steak_install_generator_spec.rb
143
143
  - spec/acceptance/rspec-2/steak_spec_generator_spec.rb
144
+ - generators/acceptance_spec/acceptance_spec_generator.rb
145
+ - generators/acceptance_spec/templates/acceptance_spec.rb
146
+ - generators/acceptance_spec/USAGE
147
+ - generators/steak/steak_generator.rb
148
+ - generators/steak/templates/acceptance_helper.rb
149
+ - generators/steak/templates/helpers.rb
150
+ - generators/steak/templates/paths.rb
151
+ - generators/steak/templates/steak.rake
152
+ - generators/steak/USAGE
144
153
  has_rdoc: true
145
154
  homepage: http://github.com/cavalle/steak
146
155
  licenses: []