steak 1.0.0.rc.3 → 1.0.0.rc.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -8,6 +8,7 @@ task :default => :spec
8
8
 
9
9
  desc 'Run specs for the steak plugin.'
10
10
  RSpec::Core::RakeTask.new(:spec) do |t|
11
+ t.skip_bundler = true
11
12
  t.pattern = FileList["spec/**/*_spec.rb"]
12
13
  end
13
14
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/acceptance_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
2
2
 
3
3
  feature "Feature name", %q{
4
4
  In order to ...
@@ -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 options[:driver] == 'webrat' %>
4
4
  require "webrat"
@@ -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
- RSpec.configuration.include Capybara, :type => :acceptance
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
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/<%= @relative_path %>acceptance_helper'
1
+ require File.expand_path(File.dirname(__FILE__) + '/<%= @relative_path %>acceptance_helper')
2
2
 
3
3
  feature "<%= @feature_name %>", %q{
4
4
  In order to ...
data/lib/steak.rb CHANGED
@@ -4,7 +4,7 @@ rescue LoadError
4
4
  require 'spec'
5
5
  end
6
6
 
7
- if defined?(RSpec)
7
+ if defined?(RSpec::Core)
8
8
  require 'rspec-2/steak'
9
9
  else
10
10
  require 'rspec-1/steak'
@@ -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 1.8.7@steak-rspec-1 exec #{cmd} 2>&1`.tap do |o|
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
- `rvm #{gemset} gem search #{name} -i || rvm #{gemset} gem install #{name}`
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 "1.8.7@steak-rspec-1", "rspec-rails -v '~> 1.3.0'",
81
- "rails -v '~> 2.3.8'",
82
- "webrat",
83
- "capybara",
84
- "sqlite3-ruby",
85
- "rake"
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=nil)
61
- if app_base
62
- current_dir = Dir.pwd
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
- response.should contain(/No route matches/)
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, 1 failure/
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: 15424051
4
+ hash: 15424061
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
9
  - 0
10
10
  - rc
11
- - 3
12
- version: 1.0.0.rc.3
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-17 00:00:00 +01:00
20
+ date: 2010-11-21 00:00:00 +01:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency