spork-rails 3.2.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+ gem 'sqlite3', '~> 1.3.7'
3
+ gem 'cucumber', '~> 1.3.2'
4
+ gem 'rspec', '~> 2.13.0'
5
+ gem 'rspec-rails', '~> 2.13.2'
6
+ gem 'rails', '~> 4.0'
7
+ gem 'jquery-rails'
8
+ gem 'turbolinks'
9
+
10
+ if RUBY_VERSION =~ /^2\.0|^1\.9/
11
+ gem 'debugger'
12
+ else
13
+ gem 'ruby-debug'
14
+ end
15
+ gem 'spork', '>= 1.0rc0'
16
+ gem 'spork-rails', :path => "../../../"
@@ -0,0 +1,147 @@
1
+ GIT
2
+ remote: git://github.com/sporkrb/spork.git
3
+ revision: 38ab44f0968c23509912680a04f903fe4ad5c068
4
+ specs:
5
+ spork (1.0.0rc3)
6
+
7
+ PATH
8
+ remote: ../../../
9
+ specs:
10
+ spork-rails (3.2.1)
11
+ rails (>= 3.0.0, < 5)
12
+ spork (>= 1.0rc0)
13
+
14
+ GEM
15
+ remote: https://rubygems.org/
16
+ specs:
17
+ actionmailer (4.0.0)
18
+ actionpack (= 4.0.0)
19
+ mail (~> 2.5.3)
20
+ actionpack (4.0.0)
21
+ activesupport (= 4.0.0)
22
+ builder (~> 3.1.0)
23
+ erubis (~> 2.7.0)
24
+ rack (~> 1.5.2)
25
+ rack-test (~> 0.6.2)
26
+ activemodel (4.0.0)
27
+ activesupport (= 4.0.0)
28
+ builder (~> 3.1.0)
29
+ activerecord (4.0.0)
30
+ activemodel (= 4.0.0)
31
+ activerecord-deprecated_finders (~> 1.0.2)
32
+ activesupport (= 4.0.0)
33
+ arel (~> 4.0.0)
34
+ activerecord-deprecated_finders (1.0.3)
35
+ activesupport (4.0.0)
36
+ i18n (~> 0.6, >= 0.6.4)
37
+ minitest (~> 4.2)
38
+ multi_json (~> 1.3)
39
+ thread_safe (~> 0.1)
40
+ tzinfo (~> 0.3.37)
41
+ arel (4.0.0)
42
+ atomic (1.1.10)
43
+ builder (3.1.4)
44
+ coffee-rails (4.0.0)
45
+ coffee-script (>= 2.2.0)
46
+ railties (>= 4.0.0.beta, < 5.0)
47
+ coffee-script (2.2.0)
48
+ coffee-script-source
49
+ execjs
50
+ coffee-script-source (1.6.3)
51
+ columnize (0.3.6)
52
+ cucumber (1.3.2)
53
+ builder (>= 2.1.2)
54
+ diff-lcs (>= 1.1.3)
55
+ gherkin (~> 2.12.0)
56
+ multi_json (~> 1.3)
57
+ debugger (1.6.0)
58
+ columnize (>= 0.3.1)
59
+ debugger-linecache (~> 1.2.0)
60
+ debugger-ruby_core_source (~> 1.2.1)
61
+ debugger-linecache (1.2.0)
62
+ debugger-ruby_core_source (1.2.3)
63
+ diff-lcs (1.2.4)
64
+ erubis (2.7.0)
65
+ execjs (1.4.0)
66
+ multi_json (~> 1.0)
67
+ gherkin (2.12.0)
68
+ multi_json (~> 1.3)
69
+ hike (1.2.3)
70
+ i18n (0.6.4)
71
+ jquery-rails (3.0.2)
72
+ railties (>= 3.0, < 5.0)
73
+ thor (>= 0.14, < 2.0)
74
+ mail (2.5.4)
75
+ mime-types (~> 1.16)
76
+ treetop (~> 1.4.8)
77
+ mime-types (1.23)
78
+ minitest (4.7.5)
79
+ multi_json (1.7.7)
80
+ polyglot (0.3.3)
81
+ rack (1.5.2)
82
+ rack-test (0.6.2)
83
+ rack (>= 1.0)
84
+ rails (4.0.0)
85
+ actionmailer (= 4.0.0)
86
+ actionpack (= 4.0.0)
87
+ activerecord (= 4.0.0)
88
+ activesupport (= 4.0.0)
89
+ bundler (>= 1.3.0, < 2.0)
90
+ railties (= 4.0.0)
91
+ sprockets-rails (~> 2.0.0)
92
+ railties (4.0.0)
93
+ actionpack (= 4.0.0)
94
+ activesupport (= 4.0.0)
95
+ rake (>= 0.8.7)
96
+ thor (>= 0.18.1, < 2.0)
97
+ rake (10.1.0)
98
+ rspec (2.13.0)
99
+ rspec-core (~> 2.13.0)
100
+ rspec-expectations (~> 2.13.0)
101
+ rspec-mocks (~> 2.13.0)
102
+ rspec-core (2.13.1)
103
+ rspec-expectations (2.13.0)
104
+ diff-lcs (>= 1.1.3, < 2.0)
105
+ rspec-mocks (2.13.1)
106
+ rspec-rails (2.13.2)
107
+ actionpack (>= 3.0)
108
+ activesupport (>= 3.0)
109
+ railties (>= 3.0)
110
+ rspec-core (~> 2.13.0)
111
+ rspec-expectations (~> 2.13.0)
112
+ rspec-mocks (~> 2.13.0)
113
+ sprockets (2.10.0)
114
+ hike (~> 1.2)
115
+ multi_json (~> 1.0)
116
+ rack (~> 1.0)
117
+ tilt (~> 1.1, != 1.3.0)
118
+ sprockets-rails (2.0.0)
119
+ actionpack (>= 3.0)
120
+ activesupport (>= 3.0)
121
+ sprockets (~> 2.8)
122
+ sqlite3 (1.3.7)
123
+ thor (0.18.1)
124
+ thread_safe (0.1.0)
125
+ atomic
126
+ tilt (1.4.1)
127
+ treetop (1.4.14)
128
+ polyglot
129
+ polyglot (>= 0.3.1)
130
+ turbolinks (1.2.0)
131
+ coffee-rails
132
+ tzinfo (0.3.37)
133
+
134
+ PLATFORMS
135
+ ruby
136
+
137
+ DEPENDENCIES
138
+ cucumber (~> 1.3.2)
139
+ debugger
140
+ jquery-rails
141
+ rails (~> 4.0)
142
+ rspec (~> 2.13.0)
143
+ rspec-rails (~> 2.13.2)
144
+ spork!
145
+ spork-rails!
146
+ sqlite3 (~> 1.3.7)
147
+ turbolinks
@@ -1,3 +1,4 @@
1
+ @rails4
1
2
  Feature: Rails Delayed Work arounds
2
3
  To allow a rails developer to update as many parts of his application as possible without needing to restart Spork
3
4
  Spork automatically tells rails to delay loading certain parts of the application until after the fork occurs
@@ -20,7 +21,7 @@ Feature: Rails Delayed Work arounds
20
21
  Spork.each_run do
21
22
  end
22
23
  """
23
- And the application has a model, observer, route, and application helper
24
+ And the application has a model, route, and application helper
24
25
 
25
26
  Given the following code appears in "config/routes.rb" after /routes\.draw/:
26
27
  """
@@ -44,6 +45,7 @@ Feature: Rails Delayed Work arounds
44
45
  Given a file named "app/controllers/users_controller.rb" with:
45
46
  """
46
47
  class UsersController < ApplicationController
48
+ config.relative_url_root = ""
47
49
  $loaded_stuff << 'UsersController'
48
50
  def index
49
51
  @users = []
@@ -0,0 +1,85 @@
1
+ @rails4
2
+ Feature: Rails Integration
3
+ To get a developer up and running quickly
4
+ Spork automatically integrates with rails
5
+ Providing default hooks and behaviors
6
+
7
+ Background: Rails App with RSpec and Spork
8
+ Given I am in a fresh rails project named "test_rails_project"
9
+ And a file named "spec/spec_helper.rb" with:
10
+ """
11
+ require 'rubygems'
12
+ require 'spork'
13
+
14
+ Spork.prefork do
15
+ # Loading more in this block will cause your specs to run faster. However,
16
+ # if you change any configuration or code from libraries loaded here, you'll
17
+ # need to restart spork for it take effect.
18
+ require File.dirname(__FILE__) + '/../config/environment.rb'
19
+ require 'rspec'
20
+ require 'rspec/rails'
21
+
22
+ #### this is for this test only #######
23
+ $loaded_stuff << 'prefork block' ######
24
+ #######################################
25
+ end
26
+
27
+ Spork.each_run do
28
+ # This code will be run each time you run your specs.
29
+
30
+ #### this is for this test only #######
31
+ $loaded_stuff << 'each_run block' #####
32
+ #######################################
33
+ end
34
+ """
35
+ And the application has a model, route, and application helper
36
+ Scenario: Analyzing files were preloaded
37
+ When I run spork --diagnose
38
+ Then the output should not contain "app/controllers/application.rb"
39
+ Then the output should not contain "app/controllers/application_controller.rb"
40
+ Then the output should not contain "app/controllers/application_helper.rb"
41
+ # Then the output should not contain "config/routes.rb"
42
+
43
+ Scenario: Running spork with a rails app
44
+ Given a file named "spec/did_it_work_spec.rb" with:
45
+ """
46
+ require 'spec_helper'
47
+ describe "Did it work?" do
48
+ it "checks to see if all worked" do
49
+ Spork.using_spork?.should == true
50
+ (Rails.respond_to?(:logger) ? Rails.logger : ActionController::Base.logger).info "hey there"
51
+ $loaded_stuff.should include('ApplicationHelper')
52
+ $loaded_stuff.should include('config/routes.rb')
53
+ $loaded_stuff.should include('each_run block')
54
+ $loaded_stuff.should include('prefork block')
55
+ puts "Specs successfully run within spork, and all initialization files were loaded"
56
+ end
57
+ end
58
+ """
59
+ When I fire up a spork instance with "spork rspec"
60
+ And I run rspec --drb spec/did_it_work_spec.rb
61
+ Then the error output should be empty
62
+ And the output should contain "Specs successfully run within spork, and all initialization files were loaded"
63
+ And the file "log/test.log" should include "hey there"
64
+
65
+
66
+ Scenario: Running spork with a rails app and a non-standard port
67
+ Given a file named "spec/did_it_work_spec.rb" with:
68
+ """
69
+ describe "Did it work?" do
70
+ it "checks to see if all worked" do
71
+ Spork.using_spork?.should == true
72
+ (Rails.respond_to?(:logger) ? Rails.logger : ActionController::Base.logger).info "hey there"
73
+ $loaded_stuff.should include('ApplicationHelper')
74
+ $loaded_stuff.should include('config/routes.rb')
75
+ $loaded_stuff.should include('each_run block')
76
+ $loaded_stuff.should include('prefork block')
77
+ puts "Specs successfully run within spork, and all initialization files were loaded"
78
+ end
79
+ end
80
+ """
81
+ When I fire up a spork instance with "spork rspec --port 7000"
82
+ And I run rspec --drb --drb-port 7000 spec/did_it_work_spec.rb
83
+ Then the error output should be empty
84
+ And the output should contain "Specs successfully run within spork, and all initialization files were loaded"
85
+ And the file "log/test.log" should include "hey there"
@@ -66,3 +66,38 @@ Given "the application has a model, observer, route, and application helper" do
66
66
  end
67
67
  """
68
68
  end
69
+
70
+ Given "the application has a model, route, and application helper" do
71
+ Given 'a file named "app/models/user.rb" with:',
72
+ """
73
+ class User < ActiveRecord::Base
74
+ $loaded_stuff << 'User'
75
+ end
76
+ """
77
+ Given 'a file named "app/helpers/application_helper.rb" with:',
78
+ """
79
+ module ApplicationHelper
80
+ $loaded_stuff << 'ApplicationHelper'
81
+ end
82
+ """
83
+ Given 'the following code appears in "config/routes.rb" after /^end/:',
84
+ """
85
+ $loaded_stuff << 'config/routes.rb'
86
+ """
87
+ Given 'a file named "config/initializers/initialize_loaded_stuff.rb" with:',
88
+ """
89
+ $loaded_stuff ||= []
90
+ """
91
+ Given 'a file named "config/initializers/log_establish_connection_calls.rb" with:',
92
+ """
93
+ class ActiveRecord::Base
94
+ class << self
95
+ def establish_connection_with_load_logging(*args)
96
+ $loaded_stuff << 'ActiveRecord::Base.establish_connection'
97
+ establish_connection_without_load_logging(*args)
98
+ end
99
+ alias_method_chain :establish_connection, :load_logging
100
+ end
101
+ end
102
+ """
103
+ end
@@ -3,7 +3,7 @@ require "spork/test/cucumber_helpers.rb"
3
3
  APP_ROOT = Pathname.new(File.expand_path('../../', File.dirname(__FILE__)))
4
4
  SANDBOX_DIR = APP_ROOT + "tmp/sandbox"
5
5
 
6
- BundlerHelpers.set_gemfile(APP_ROOT + "features/gemsets/#{ENV["GEMSET"] || 'rails3.1'}/Gemfile")
6
+ BundlerHelpers.set_gemfile(APP_ROOT + "features/gemsets/#{ENV["GEMSET"] || 'rails3.2'}/Gemfile")
7
7
 
8
8
  World do
9
9
  SporkWorld.new
@@ -54,7 +54,7 @@ class Spork::AppFramework::Rails < Spork::AppFramework
54
54
  end
55
55
  end
56
56
  # Spork.trap_method(::AbstractController::Helpers::ClassMethods, :helper)
57
- Spork.trap_method(::ActiveModel::Observing::ClassMethods, :instantiate_observers)
57
+ Spork.trap_method(::ActiveModel::Observing::ClassMethods, :instantiate_observers) if defined?(ActiveModel::Observing)
58
58
  Spork.each_run { ActiveRecord::Base.establish_connection rescue nil } if Object.const_defined?(:ActiveRecord)
59
59
 
60
60
 
@@ -65,7 +65,11 @@ class Spork::AppFramework::Rails < Spork::AppFramework
65
65
  filename = arg + "_helper"
66
66
  unless ::ActiveSupport::Dependencies.search_for_file(filename)
67
67
  # this error message must raise in the format such that LoadError#path returns the filename
68
- raise LoadError.new("Missing helper file helpers/%s.rb" % filename)
68
+ e = LoadError.new("Missing helper file helpers/%s.rb" % filename)
69
+ if e.respond_to?(:path)
70
+ e.instance_variable_set("@path", "helpers/%s.rb" % filename)
71
+ end
72
+ raise e
69
73
  end
70
74
  end
71
75
 
metadata CHANGED
@@ -1,44 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spork-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
5
- prerelease:
4
+ version: 4.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tim Harper
8
+ - Sahil Muthoo
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000Z
12
+ date: 2013-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spork
16
- requirement: &70323949187580 !ruby/object:Gem::Requirement
17
- none: false
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  requirements:
19
- - - ! '>='
18
+ - - '>='
20
19
  - !ruby/object:Gem::Version
21
20
  version: 1.0rc0
22
21
  type: :runtime
23
22
  prerelease: false
24
- version_requirements: *70323949187580
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.0rc0
25
28
  - !ruby/object:Gem::Dependency
26
29
  name: rails
27
- requirement: &70323949186720 !ruby/object:Gem::Requirement
28
- none: false
30
+ requirement: !ruby/object:Gem::Requirement
29
31
  requirements:
30
- - - ! '>='
32
+ - - '>='
31
33
  - !ruby/object:Gem::Version
32
34
  version: 3.0.0
33
35
  - - <
34
36
  - !ruby/object:Gem::Version
35
- version: 3.3.0
37
+ version: '5'
36
38
  type: :runtime
37
39
  prerelease: false
38
- version_requirements: *70323949186720
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: 3.0.0
45
+ - - <
46
+ - !ruby/object:Gem::Version
47
+ version: '5'
39
48
  description: Plugin for Spork to support Rails.
40
49
  email:
41
50
  - timcharper+spork@gmail.com
51
+ - sahil.muthoo@gmail.com
42
52
  executables: []
43
53
  extensions: []
44
54
  extra_rdoc_files:
@@ -50,6 +60,7 @@ files:
50
60
  - MIT-LICENSE
51
61
  - lib/spork/app_framework/rails.rb
52
62
  - lib/spork/ext/rails-reloader.rb
63
+ - features/cucumber_rails4_integration.feature
53
64
  - features/cucumber_rails_integration.feature
54
65
  - features/gemsets/rails3.0/Gemfile
55
66
  - features/gemsets/rails3.0/Gemfile.lock
@@ -57,7 +68,10 @@ files:
57
68
  - features/gemsets/rails3.1/Gemfile.lock
58
69
  - features/gemsets/rails3.2/Gemfile
59
70
  - features/gemsets/rails3.2/Gemfile.lock
71
+ - features/gemsets/rails4.0/Gemfile
72
+ - features/gemsets/rails4.0/Gemfile.lock
60
73
  - features/rails_delayed_loading_workarounds.feature
74
+ - features/rspec_rails4_integration.feature
61
75
  - features/rspec_rails_integration.feature
62
76
  - features/steps/rails_steps.rb
63
77
  - features/support/env.rb
@@ -67,6 +81,7 @@ files:
67
81
  - spec/tmp/config/environment.rb
68
82
  homepage: http://github.com/sporkrb/spork-rails
69
83
  licenses: []
84
+ metadata: {}
70
85
  post_install_message:
71
86
  rdoc_options:
72
87
  - --main
@@ -74,24 +89,23 @@ rdoc_options:
74
89
  require_paths:
75
90
  - lib
76
91
  required_ruby_version: !ruby/object:Gem::Requirement
77
- none: false
78
92
  requirements:
79
- - - ! '>='
93
+ - - '>='
80
94
  - !ruby/object:Gem::Version
81
95
  version: '0'
82
96
  required_rubygems_version: !ruby/object:Gem::Requirement
83
- none: false
84
97
  requirements:
85
- - - ! '>='
98
+ - - '>='
86
99
  - !ruby/object:Gem::Version
87
100
  version: '0'
88
101
  requirements: []
89
102
  rubyforge_project: spork
90
- rubygems_version: 1.8.7
103
+ rubygems_version: 2.1.3
91
104
  signing_key:
92
- specification_version: 3
105
+ specification_version: 4
93
106
  summary: spork
94
107
  test_files:
108
+ - features/cucumber_rails4_integration.feature
95
109
  - features/cucumber_rails_integration.feature
96
110
  - features/gemsets/rails3.0/Gemfile
97
111
  - features/gemsets/rails3.0/Gemfile.lock
@@ -99,7 +113,10 @@ test_files:
99
113
  - features/gemsets/rails3.1/Gemfile.lock
100
114
  - features/gemsets/rails3.2/Gemfile
101
115
  - features/gemsets/rails3.2/Gemfile.lock
116
+ - features/gemsets/rails4.0/Gemfile
117
+ - features/gemsets/rails4.0/Gemfile.lock
102
118
  - features/rails_delayed_loading_workarounds.feature
119
+ - features/rspec_rails4_integration.feature
103
120
  - features/rspec_rails_integration.feature
104
121
  - features/steps/rails_steps.rb
105
122
  - features/support/env.rb
@@ -107,4 +124,3 @@ test_files:
107
124
  - spec/spork/app_framework/rails_spec.rb
108
125
  - spec/spork/app_framework_spec.rb
109
126
  - spec/tmp/config/environment.rb
110
- has_rdoc: