steak 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ spec = Gem::Specification.new do |s|
21
21
 
22
22
  # Change these as appropriate
23
23
  s.name = "steak"
24
- s.version = "0.3.5"
24
+ s.version = "0.3.6"
25
25
  s.summary = "If you are not in Rails but use RSpec, then Steak is just some aliases providing you with the language of acceptance testing (feature, scenario, background). If you are in Rails, you also have a couple of generators, a rake task and full Rails integration testing (meaning Webrat support, for instance)"
26
26
  s.description = "Minimalist acceptance testing on top of RSpec"
27
27
  s.author = "Luismi Cavallé"
@@ -33,7 +33,7 @@ spec = Gem::Specification.new do |s|
33
33
  s.rdoc_options = %w(--main README.rdoc)
34
34
 
35
35
  # Add any extra files to include in the gem
36
- s.files = %w(init.rb MIT-LICENSE Rakefile README.rdoc) + Dir.glob("{spec,lib/**/*}")
36
+ s.files = %w(init.rb MIT-LICENSE Rakefile README.rdoc) + Dir.glob("{spec,lib/**/*,generators/**/*}")
37
37
  s.require_paths = ["lib"]
38
38
 
39
39
  # If you want to depend on other gems, add them here, along with any
File without changes
@@ -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,13 @@
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
+
13
+ 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,16 @@
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
+ include Capybara
13
+ <%- end -%>
14
+
15
+ # Put your acceptance spec helpers inside /spec/acceptance/support
16
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -0,0 +1,6 @@
1
+ module HelperMethods
2
+ # Put here any helper method you need to be available in all your acceptance tests
3
+
4
+ end
5
+
6
+ Spec::Runner.configuration.include(HelperMethods)
@@ -0,0 +1,9 @@
1
+ module NavigationHelpers
2
+ # Put here the helper methods related to the paths of your applications
3
+
4
+ def homepage
5
+ "/"
6
+ end
7
+ end
8
+
9
+ Spec::Runner.configuration.include(NavigationHelpers)
@@ -0,0 +1,13 @@
1
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
2
+
3
+ load File.dirname(__FILE__) + '/rspec.rake'
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
+ end
12
+
13
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 5
9
- version: 0.3.5
8
+ - 6
9
+ version: 0.3.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Luismi Cavall\xC3\xA9"
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-02 00:00:00 +02:00
17
+ date: 2010-05-05 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -43,6 +43,15 @@ files:
43
43
  - Rakefile
44
44
  - README.rdoc
45
45
  - lib/steak.rb
46
+ - generators/acceptance_spec/acceptance_spec_generator.rb
47
+ - generators/acceptance_spec/templates/acceptance_spec.rb
48
+ - generators/acceptance_spec/USAGE
49
+ - generators/steak/steak_generator.rb
50
+ - generators/steak/templates/acceptance_helper.rb
51
+ - generators/steak/templates/helpers.rb
52
+ - generators/steak/templates/paths.rb
53
+ - generators/steak/templates/steak.rake
54
+ - generators/steak/USAGE
46
55
  has_rdoc: true
47
56
  homepage: http://github.com/cavalle/steak
48
57
  licenses: []