steak 1.0.0.rc.3 → 1.0.0.rc.4
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 +1 -0
- data/generators/acceptance_spec/templates/acceptance_spec.rb +1 -1
- data/generators/steak/templates/acceptance_helper.rb +1 -1
- data/lib/rspec-2/rails/generators/templates/acceptance_helper.rb +12 -3
- data/lib/rspec-2/rails/generators/templates/acceptance_spec.rb +1 -1
- data/lib/steak.rb +1 -1
- data/spec/acceptance/rspec-1/acceptance_helper.rb +11 -8
- data/spec/acceptance/rspec-1/steak_generator_spec.rb +3 -3
- data/spec/acceptance/rspec-2/acceptance_helper.rb +3 -9
- data/spec/acceptance/rspec-2/rails_spec.rb +2 -3
- metadata +4 -4
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/../spec_helper"
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
|
2
2
|
require "steak"
|
3
3
|
<%- if driver == 'webrat' %>
|
4
4
|
require "webrat"
|
@@ -13,7 +13,7 @@ module Steak::Webrat
|
|
13
13
|
include Webrat::Matchers
|
14
14
|
|
15
15
|
def app
|
16
|
-
Rails.application
|
16
|
+
::Rails.application
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -22,7 +22,16 @@ RSpec.configuration.include Steak::Webrat, :type => :acceptance
|
|
22
22
|
<%- else -%>
|
23
23
|
require 'capybara/rails'
|
24
24
|
|
25
|
-
|
25
|
+
module Steak::Capybara
|
26
|
+
include Rack::Test::Methods
|
27
|
+
include Capybara
|
28
|
+
|
29
|
+
def app
|
30
|
+
::Rails.application
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec.configuration.include Steak::Capybara, :type => :acceptance
|
26
35
|
<%- end -%>
|
27
36
|
|
28
37
|
# Put your acceptance spec helpers inside /spec/acceptance/support
|
data/lib/steak.rb
CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rspec'
|
3
3
|
require File.dirname(__FILE__) + "/../../../lib/steak"
|
4
4
|
require 'tempfile'
|
5
|
+
require 'shellwords'
|
5
6
|
|
6
7
|
module RSpec_1
|
7
8
|
module Factories
|
@@ -44,7 +45,7 @@ module RSpec_1
|
|
44
45
|
module HelperMethods
|
45
46
|
def run(cmd)
|
46
47
|
puts cmd if trace?
|
47
|
-
`rvm
|
48
|
+
`rvm @steak-rspec-1 exec #{cmd} 2>&1`.tap do |o|
|
48
49
|
puts o if trace? and o
|
49
50
|
end
|
50
51
|
end
|
@@ -69,7 +70,8 @@ module RSpec_1
|
|
69
70
|
def self.gemset_create(gemset, *gems)
|
70
71
|
`rvm gemset create #{gemset}`
|
71
72
|
gems.each do |name|
|
72
|
-
|
73
|
+
name = Shellwords.escape(name)
|
74
|
+
`rvm @#{gemset} gem search #{name} -i || rvm @#{gemset} gem install #{name}`
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -77,12 +79,13 @@ module RSpec_1
|
|
77
79
|
config.include Factories, :example_group => { :file_path => /rspec-1/}
|
78
80
|
config.include HelperMethods, :example_group => { :file_path => /rspec-1/}
|
79
81
|
config.before :suite do
|
80
|
-
gemset_create "
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
gemset_create "steak-rspec-1", "rspec-rails -v '~> 1'",
|
83
|
+
"rails -v '~> 2'",
|
84
|
+
"webrat",
|
85
|
+
"capybara",
|
86
|
+
"sqlite3-ruby",
|
87
|
+
"rake",
|
88
|
+
"test-unit -v '1.2.3'"
|
86
89
|
end
|
87
90
|
end
|
88
91
|
end
|
@@ -28,7 +28,7 @@ feature "Steak generator for rails", %q{
|
|
28
28
|
|
29
29
|
spec_file = create_spec :path => rails_app + "/spec/acceptance",
|
30
30
|
:content => <<-SPEC
|
31
|
-
require File.dirname(__FILE__) + "/acceptance_helper.rb"
|
31
|
+
require File.expand_path(File.dirname(__FILE__) + "/acceptance_helper.rb")
|
32
32
|
feature "Capybara spec" do
|
33
33
|
scenario "First scenario" do
|
34
34
|
visit "/"
|
@@ -49,7 +49,7 @@ feature "Steak generator for rails", %q{
|
|
49
49
|
|
50
50
|
spec_file = create_spec :path => rails_app + "/spec/acceptance",
|
51
51
|
:content => <<-SPEC
|
52
|
-
require File.dirname(__FILE__) + "/acceptance_helper.rb"
|
52
|
+
require File.expand_path(File.dirname(__FILE__) + "/acceptance_helper.rb")
|
53
53
|
feature "Capybara spec" do
|
54
54
|
scenario "First scenario" do
|
55
55
|
visit "/"
|
@@ -75,7 +75,7 @@ feature "Steak generator for rails", %q{
|
|
75
75
|
|
76
76
|
spec_file = create_spec :path => rails_app + "/spec/acceptance",
|
77
77
|
:content => <<-SPEC
|
78
|
-
require File.dirname(__FILE__) + "/acceptance_helper.rb"
|
78
|
+
require File.expand_path(File.dirname(__FILE__) + "/acceptance_helper.rb")
|
79
79
|
feature "Basic spec" do
|
80
80
|
scenario "First scenario" do
|
81
81
|
true.should == true
|
@@ -57,16 +57,10 @@ module RSpec_2
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def run_spec(file_path, app_base=
|
61
|
-
|
62
|
-
|
63
|
-
Dir.chdir app_base
|
60
|
+
def run_spec(file_path, app_base=Dir.pwd)
|
61
|
+
Dir.chdir app_base do
|
62
|
+
run("rspec #{file_path}")
|
64
63
|
end
|
65
|
-
|
66
|
-
output = run("rspec #{file_path}")
|
67
|
-
|
68
|
-
Dir.chdir current_dir if app_base
|
69
|
-
output
|
70
64
|
end
|
71
65
|
end
|
72
66
|
|
@@ -13,7 +13,6 @@ feature "Acceptance spec execution", %q{
|
|
13
13
|
require File.dirname(__FILE__) + "/acceptance_helper.rb"
|
14
14
|
feature "Minimal spec" do
|
15
15
|
scenario "First scenario" do
|
16
|
-
# Rails.env.should_not be_nil
|
17
16
|
::Rails.env.should == "test"
|
18
17
|
end
|
19
18
|
end
|
@@ -30,12 +29,12 @@ feature "Acceptance spec execution", %q{
|
|
30
29
|
feature "Minimal spec" do
|
31
30
|
scenario "First scenario" do
|
32
31
|
get "/"
|
33
|
-
|
32
|
+
last_response.body.should =~ /Not Found/
|
34
33
|
end
|
35
34
|
end
|
36
35
|
SPEC
|
37
36
|
output = run_spec spec_file, File.join(File.dirname(spec_file), '../..')
|
38
|
-
output.should =~ /1 example,
|
37
|
+
output.should =~ /1 example, 0 failures/
|
39
38
|
end
|
40
39
|
|
41
40
|
scenario "Path helpers are available" do
|
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:
|
4
|
+
hash: 15424061
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 1.0.0.rc.
|
11
|
+
- 4
|
12
|
+
version: 1.0.0.rc.4
|
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-11-
|
20
|
+
date: 2010-11-21 00:00:00 +01:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|