steak 0.3.5 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- data/generators/acceptance_spec/USAGE +0 -0
- data/generators/acceptance_spec/acceptance_spec_generator.rb +9 -0
- data/generators/acceptance_spec/templates/acceptance_spec.rb +13 -0
- data/generators/steak/USAGE +8 -0
- data/generators/steak/steak_generator.rb +26 -0
- data/generators/steak/templates/acceptance_helper.rb +16 -0
- data/generators/steak/templates/helpers.rb +6 -0
- data/generators/steak/templates/paths.rb +9 -0
- data/generators/steak/templates/steak.rake +13 -0
- metadata +12 -3
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.
|
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,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,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
|
-
-
|
9
|
-
version: 0.3.
|
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-
|
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: []
|