spork 0.9.0-x86-mswin32 → 1.0.0rc0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/Gemfile +3 -1
  2. data/README.rdoc +22 -18
  3. data/features/diagnostic_mode.feature +1 -2
  4. data/features/support/bundler_helpers.rb +2 -8
  5. data/features/support/env.rb +7 -94
  6. data/features/support/spork_world.rb +84 -0
  7. data/features/unknown_app_framework.feature +5 -7
  8. data/lib/spork/app_framework/unknown.rb +5 -1
  9. data/lib/spork/app_framework.rb +16 -30
  10. data/lib/spork/runner.rb +1 -1
  11. data/lib/spork/test/cucumber_helpers.rb +5 -0
  12. data/lib/spork/test/test_helpers.rb +2 -0
  13. data/lib/spork/test_framework.rb +9 -9
  14. data/lib/spork.rb +3 -10
  15. data/spec/spec_helper.rb +7 -88
  16. data/spec/spork/app_framework_spec.rb +0 -7
  17. data/spec/spork/diagnoser_spec.rb +0 -1
  18. data/spec/spork/test_framework_spec.rb +3 -3
  19. data/spec/support/fake_framework.rb +3 -1
  20. data/spec/support/should_include_a_string_like.rb +31 -0
  21. data/spec/support/test_io_streams.rb +17 -0
  22. data/spec/support/tmp_project_helpers.rb +30 -0
  23. metadata +26 -37
  24. data/assets/bootstrap.rb +0 -49
  25. data/features/cucumber_rails_integration.feature +0 -107
  26. data/features/gemfiles/rails3.0/Gemfile +0 -14
  27. data/features/gemfiles/rails3.0/Gemfile.lock +0 -139
  28. data/features/rails_delayed_loading_workarounds.feature +0 -177
  29. data/features/rspec_rails_integration.feature +0 -92
  30. data/features/steps/rails_steps.rb +0 -67
  31. data/lib/spork/app_framework/padrino.rb +0 -22
  32. data/lib/spork/app_framework/rails.rb +0 -82
  33. data/lib/spork/ext/rails-reloader.rb +0 -14
  34. data/lib/spork/gem_helpers.rb +0 -38
  35. data/spec/spork/app_framework/rails_spec.rb +0 -22
@@ -1,5 +1,7 @@
1
+ require "#{File.dirname(__FILE__)}/test_io_streams.rb"
2
+
1
3
  class FakeFramework < Spork::TestFramework
2
- include Spork::TestIOStreams
4
+ include TestIOStreams
3
5
 
4
6
  attr_accessor :wait_time
5
7
  DEFAULT_PORT = 1000
@@ -0,0 +1,31 @@
1
+ module RSpec
2
+ module Matchers
3
+ class IncludeAStringLike
4
+ def initialize(substring_or_regex)
5
+ case substring_or_regex
6
+ when String
7
+ @regex = Regexp.new(Regexp.escape(substring_or_regex))
8
+ when Regexp
9
+ @regex = substring_or_regex
10
+ else
11
+ raise ArgumentError, "don't know what to do with the #{substring_or_regex.class} you provided"
12
+ end
13
+ end
14
+
15
+ def matches?(list_of_strings)
16
+ @list_of_strings = list_of_strings
17
+ @list_of_strings.any? { |s| s =~ @regex }
18
+ end
19
+ def failure_message
20
+ "#{@list_of_strings.inspect} expected to include a string like #{@regex.inspect}"
21
+ end
22
+ def negative_failure_message
23
+ "#{@list_of_strings.inspect} expected to not include a string like #{@regex.inspect}, but did"
24
+ end
25
+ end
26
+
27
+ def include_a_string_like(substring_or_regex)
28
+ IncludeAStringLike.new(substring_or_regex)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,17 @@
1
+ module TestIOStreams
2
+ def stderr
3
+ ::TestIOStreams.stderr
4
+ end
5
+
6
+ def stdout
7
+ ::TestIOStreams.stdout
8
+ end
9
+
10
+ class << self
11
+ attr_accessor :stderr, :stdout
12
+
13
+ def set_streams(stderr, stdout)
14
+ self.stderr, self.stdout = stderr, stdout
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,30 @@
1
+ module TmpProjectHelpers
2
+ def clear_tmp_dir
3
+ FileUtils.rm_rf(SPEC_TMP_DIR) if File.directory?(SPEC_TMP_DIR)
4
+ end
5
+
6
+ def create_file(filename, contents)
7
+ FileUtils.mkdir_p(SPEC_TMP_DIR) unless File.directory?(SPEC_TMP_DIR)
8
+
9
+ in_current_dir do
10
+ FileUtils.mkdir_p(File.dirname(filename))
11
+ File.open(filename, 'wb') { |f| f << contents }
12
+ end
13
+ end
14
+
15
+ def create_helper_file(test_framework = FakeFramework)
16
+ create_file(test_framework.helper_file, "# stub spec helper file")
17
+ end
18
+
19
+ def in_current_dir(&block)
20
+ Dir.chdir(current_dir, &block)
21
+ end
22
+
23
+ def current_dir
24
+ @current_dir ||= SPEC_TMP_DIR
25
+ end
26
+
27
+ def change_current_dir(sub_path)
28
+ @current_dir = File.expand_path(sub_path, SPEC_TMP_DIR)
29
+ end
30
+ end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
5
- prerelease:
4
+ version: 1.0.0rc0
5
+ prerelease: 5
6
6
  platform: x86-mswin32
7
7
  authors:
8
8
  - Tim Harper
@@ -14,7 +14,7 @@ date: 2012-01-22 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: win32-process
17
- requirement: &70276647716860 !ruby/object:Gem::Requirement
17
+ requirement: &70218932047280 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70276647716860
25
+ version_requirements: *70218932047280
26
26
  description: A forking Drb spec server
27
27
  email:
28
28
  - timcharper+spork@gmail.com
@@ -36,16 +36,12 @@ files:
36
36
  - Gemfile
37
37
  - README.rdoc
38
38
  - MIT-LICENSE
39
- - lib/spork/app_framework/padrino.rb
40
- - lib/spork/app_framework/rails.rb
41
39
  - lib/spork/app_framework/unknown.rb
42
40
  - lib/spork/app_framework.rb
43
41
  - lib/spork/custom_io_streams.rb
44
42
  - lib/spork/diagnoser.rb
45
- - lib/spork/ext/rails-reloader.rb
46
43
  - lib/spork/ext/ruby-debug.rb
47
44
  - lib/spork/forker.rb
48
- - lib/spork/gem_helpers.rb
49
45
  - lib/spork/run_strategy/forking.rb
50
46
  - lib/spork/run_strategy/magazine/magazine_slave.rb
51
47
  - lib/spork/run_strategy/magazine/magazine_slave_provider.rb
@@ -54,28 +50,13 @@ files:
54
50
  - lib/spork/run_strategy.rb
55
51
  - lib/spork/runner.rb
56
52
  - lib/spork/server.rb
53
+ - lib/spork/test/cucumber_helpers.rb
54
+ - lib/spork/test/test_helpers.rb
57
55
  - lib/spork/test_framework/cucumber.rb
58
56
  - lib/spork/test_framework/rspec.rb
59
57
  - lib/spork/test_framework.rb
60
58
  - lib/spork.rb
61
- - assets/bootstrap.rb
62
- - features/at_exit_during_each_run.feature
63
- - features/cucumber_rails_integration.feature
64
- - features/diagnostic_mode.feature
65
- - features/gemfiles/rails3.0/Gemfile
66
- - features/gemfiles/rails3.0/Gemfile.lock
67
- - features/rails_delayed_loading_workarounds.feature
68
- - features/rspec_rails_integration.feature
69
- - features/spork_debugger.feature
70
- - features/steps/general_steps.rb
71
- - features/steps/rails_steps.rb
72
- - features/steps/sandbox_steps.rb
73
- - features/support/background_job.rb
74
- - features/support/bundler_helpers.rb
75
- - features/support/env.rb
76
- - features/unknown_app_framework.feature
77
59
  - spec/spec_helper.rb
78
- - spec/spork/app_framework/rails_spec.rb
79
60
  - spec/spork/app_framework/unknown_spec.rb
80
61
  - spec/spork/app_framework_spec.rb
81
62
  - spec/spork/diagnoser_spec.rb
@@ -90,8 +71,21 @@ files:
90
71
  - spec/spork_spec.rb
91
72
  - spec/support/fake_framework.rb
92
73
  - spec/support/fake_run_strategy.rb
74
+ - spec/support/should_include_a_string_like.rb
75
+ - spec/support/test_io_streams.rb
76
+ - spec/support/tmp_project_helpers.rb
77
+ - features/at_exit_during_each_run.feature
78
+ - features/diagnostic_mode.feature
79
+ - features/spork_debugger.feature
80
+ - features/steps/general_steps.rb
81
+ - features/steps/sandbox_steps.rb
82
+ - features/support/background_job.rb
83
+ - features/support/bundler_helpers.rb
84
+ - features/support/env.rb
85
+ - features/support/spork_world.rb
86
+ - features/unknown_app_framework.feature
93
87
  - bin/spork
94
- homepage: http://github.com/timcharper/spork
88
+ homepage: http://github.com/sporkrb/spork
95
89
  licenses: []
96
90
  post_install_message:
97
91
  rdoc_options:
@@ -105,9 +99,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
105
99
  - - ! '>='
106
100
  - !ruby/object:Gem::Version
107
101
  version: '0'
108
- segments:
109
- - 0
110
- hash: -3774859271507225805
111
102
  required_rubygems_version: !ruby/object:Gem::Requirement
112
103
  none: false
113
104
  requirements:
@@ -115,29 +106,23 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
106
  - !ruby/object:Gem::Version
116
107
  version: '0'
117
108
  requirements: []
118
- rubyforge_project: spork
109
+ rubyforge_project:
119
110
  rubygems_version: 1.8.7
120
111
  signing_key:
121
112
  specification_version: 3
122
113
  summary: spork
123
114
  test_files:
124
115
  - features/at_exit_during_each_run.feature
125
- - features/cucumber_rails_integration.feature
126
116
  - features/diagnostic_mode.feature
127
- - features/gemfiles/rails3.0/Gemfile
128
- - features/gemfiles/rails3.0/Gemfile.lock
129
- - features/rails_delayed_loading_workarounds.feature
130
- - features/rspec_rails_integration.feature
131
117
  - features/spork_debugger.feature
132
118
  - features/steps/general_steps.rb
133
- - features/steps/rails_steps.rb
134
119
  - features/steps/sandbox_steps.rb
135
120
  - features/support/background_job.rb
136
121
  - features/support/bundler_helpers.rb
137
122
  - features/support/env.rb
123
+ - features/support/spork_world.rb
138
124
  - features/unknown_app_framework.feature
139
125
  - spec/spec_helper.rb
140
- - spec/spork/app_framework/rails_spec.rb
141
126
  - spec/spork/app_framework/unknown_spec.rb
142
127
  - spec/spork/app_framework_spec.rb
143
128
  - spec/spork/diagnoser_spec.rb
@@ -152,3 +137,7 @@ test_files:
152
137
  - spec/spork_spec.rb
153
138
  - spec/support/fake_framework.rb
154
139
  - spec/support/fake_run_strategy.rb
140
+ - spec/support/should_include_a_string_like.rb
141
+ - spec/support/test_io_streams.rb
142
+ - spec/support/tmp_project_helpers.rb
143
+ has_rdoc:
data/assets/bootstrap.rb DELETED
@@ -1,49 +0,0 @@
1
- require 'rubygems'
2
- require 'spork'
3
- #uncomment the following line to use spork with the debugger
4
- #require 'spork/ext/ruby-debug'
5
-
6
- Spork.prefork do
7
- # Loading more in this block will cause your tests to run faster. However,
8
- # if you change any configuration or code from libraries loaded here, you'll
9
- # need to restart spork for it take effect.
10
-
11
- end
12
-
13
- Spork.each_run do
14
- # This code will be run each time you run your specs.
15
-
16
- end
17
-
18
- # --- Instructions ---
19
- # Sort the contents of this file into a Spork.prefork and a Spork.each_run
20
- # block.
21
- #
22
- # The Spork.prefork block is run only once when the spork server is started.
23
- # You typically want to place most of your (slow) initializer code in here, in
24
- # particular, require'ing any 3rd-party gems that you don't normally modify
25
- # during development.
26
- #
27
- # The Spork.each_run block is run each time you run your specs. In case you
28
- # need to load files that tend to change during development, require them here.
29
- # With Rails, your application modules are loaded automatically, so sometimes
30
- # this block can remain empty.
31
- #
32
- # Note: You can modify files loaded *from* the Spork.each_run block without
33
- # restarting the spork server. However, this file itself will not be reloaded,
34
- # so if you change any of the code inside the each_run block, you still need to
35
- # restart the server. In general, if you have non-trivial code in this file,
36
- # it's advisable to move it into a separate file so you can easily edit it
37
- # without restarting spork. (For example, with RSpec, you could move
38
- # non-trivial code into a file spec/support/my_helper.rb, making sure that the
39
- # spec/support/* files are require'd from inside the each_run block.)
40
- #
41
- # Any code that is left outside the two blocks will be run during preforking
42
- # *and* during each_run -- that's probably not what you want.
43
- #
44
- # These instructions should self-destruct in 10 seconds. If they don't, feel
45
- # free to delete them.
46
-
47
-
48
-
49
-
@@ -1,107 +0,0 @@
1
- Feature: Cucumber integration with rails
2
- As a developer using cucumber and rails
3
- I want to use Spork with Cucumber
4
- In order to eliminate the startup cost of my application each time I run them
5
-
6
- Background: Sporked env.rb
7
- Given I am in a fresh rails project named "test_rails_project"
8
- And the application has a model, observer, route, and application helper
9
- And a file named "features/support/env.rb" with:
10
- """
11
- require 'rubygems'
12
- require 'spork'
13
- ENV["RAILS_ENV"] ||= "test"
14
-
15
-
16
- Spork.prefork do
17
- # Loading more in this block will cause your tests to run faster. However,
18
- # if you change any configuration or code from libraries loaded here, you'll
19
- # need to restart spork for it take effect.
20
-
21
- # Sets up the Rails environment for Cucumber
22
- require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
23
-
24
- require 'cucumber'
25
- require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
26
- require 'rspec/rails'
27
- require 'cucumber/rails/rspec'
28
-
29
- #### this is for this test only #######
30
- $loaded_stuff << 'prefork block' ######
31
- #######################################
32
- end
33
-
34
- Spork.each_run do
35
- #### this is for this test only #######
36
- $loaded_stuff << 'each_run block' #####
37
- #######################################
38
- end
39
- """
40
- And a file named "features/cucumber_rails.feature" with:
41
- """
42
- Feature: cucumber rails
43
- Scenario: did it work?
44
- Then it should work
45
-
46
- Scenario: did it work again?
47
- Then it should work
48
- """
49
- And a file named "features/support/cucumber_rails_helper.rb" with:
50
- """
51
- $loaded_stuff << 'features/support/cucumber_rails_helper.rb'
52
- """
53
- And a file named "config/database.yml" with:
54
- """
55
- test:
56
- adapter: sqlite3
57
- database: db/test.sqlite3
58
- timeout: 5000
59
- """
60
- And a file named "features/step_definitions/cucumber_rails_steps.rb" with:
61
- """
62
- Then "it should work" do
63
- (Rails.respond_to?(:logger) ? Rails.logger : ActionController::Base.logger).info "hey there"
64
- $loaded_stuff.should include('ActiveRecord::Base.establish_connection')
65
- $loaded_stuff.should include('User')
66
- $loaded_stuff.should include('UserObserver')
67
- $loaded_stuff.should include('ApplicationHelper')
68
- $loaded_stuff.should include('config/routes.rb')
69
- $loaded_stuff.should include('features/support/cucumber_rails_helper.rb')
70
- $loaded_stuff.should include('each_run block')
71
- $loaded_stuff.should include('prefork block')
72
- puts "It worked!"
73
- end
74
-
75
- Alors /ca marche/ do
76
- end
77
- """
78
- Scenario: Analyzing files were preloaded
79
- When I run spork --diagnose
80
- Then the output should not contain "user_observer.rb"
81
- Then the output should not contain "user.rb"
82
- Then the output should not contain "app/controllers/application.rb"
83
- Then the output should not contain "app/controllers/application_controller.rb"
84
- Then the output should not contain "app/controllers/application_helper.rb"
85
- Then the output should not contain "features/step_definitions/cucumber_rails_steps.rb"
86
- Then the output should not contain "features/support/cucumber_rails_helper.rb"
87
-
88
- Scenario: Running spork with a rails app and no server
89
- When I run cucumber --drb features
90
- Then the error output should contain
91
- """
92
- WARNING: No DRb server is running. Running features locally
93
- """
94
-
95
- Scenario: Running spork with a rails app and observers
96
- When I fire up a spork instance with "spork cucumber"
97
- And I run cucumber --drb features
98
- Then the error output should be empty
99
- And the output should contain "It worked!"
100
- And the file "log/test.log" should include "hey there"
101
-
102
- Scenario: Running spork with a rails app and a non-standard port
103
- When I fire up a spork instance with "spork cucumber -p 9000"
104
- And I run cucumber --drb --port 9000 features
105
- Then the error output should be empty
106
- And the output should contain "It worked!"
107
- And the file "log/test.log" should include "hey there"
@@ -1,14 +0,0 @@
1
- source :gemcutter
2
- gem 'sqlite3-ruby', '1.2.5'
3
- gem 'cucumber', '~> 1.0.0'
4
- gem 'cucumber-rails', '~> 1.0.0'
5
- gem "rspec", "2.5.0"
6
- gem 'rspec-rails', "2.5.0"
7
- gem 'rails', '3.0.7'
8
-
9
- if RUBY_VERSION =~ /^1\.9/
10
- gem 'ruby-debug19'
11
- else
12
- gem 'ruby-debug', '>= 0.10.3'
13
- end
14
- gem 'spork', :path => File.expand_path("../../..", File.dirname(__FILE__))
@@ -1,139 +0,0 @@
1
- PATH
2
- remote: /Users/timcharper/projects/spork
3
- specs:
4
- spork (0.9.0.rc8)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- abstract (1.0.0)
10
- actionmailer (3.0.7)
11
- actionpack (= 3.0.7)
12
- mail (~> 2.2.15)
13
- actionpack (3.0.7)
14
- activemodel (= 3.0.7)
15
- activesupport (= 3.0.7)
16
- builder (~> 2.1.2)
17
- erubis (~> 2.6.6)
18
- i18n (~> 0.5.0)
19
- rack (~> 1.2.1)
20
- rack-mount (~> 0.6.14)
21
- rack-test (~> 0.5.7)
22
- tzinfo (~> 0.3.23)
23
- activemodel (3.0.7)
24
- activesupport (= 3.0.7)
25
- builder (~> 2.1.2)
26
- i18n (~> 0.5.0)
27
- activerecord (3.0.7)
28
- activemodel (= 3.0.7)
29
- activesupport (= 3.0.7)
30
- arel (~> 2.0.2)
31
- tzinfo (~> 0.3.23)
32
- activeresource (3.0.7)
33
- activemodel (= 3.0.7)
34
- activesupport (= 3.0.7)
35
- activesupport (3.0.7)
36
- arel (2.0.9)
37
- builder (2.1.2)
38
- capybara (1.0.0)
39
- mime-types (>= 1.16)
40
- nokogiri (>= 1.3.3)
41
- rack (>= 1.0.0)
42
- rack-test (>= 0.5.4)
43
- selenium-webdriver (~> 0.2.0)
44
- xpath (~> 0.1.4)
45
- childprocess (0.1.9)
46
- ffi (~> 1.0.6)
47
- columnize (0.3.2)
48
- cucumber (1.0.0)
49
- builder (>= 2.1.2)
50
- diff-lcs (>= 1.1.2)
51
- gherkin (~> 2.4.1)
52
- json (>= 1.4.6)
53
- term-ansicolor (>= 1.0.5)
54
- cucumber-rails (1.0.2)
55
- capybara (>= 1.0.0)
56
- cucumber (~> 1.0.0)
57
- nokogiri (>= 1.4.6)
58
- diff-lcs (1.1.2)
59
- erubis (2.6.6)
60
- abstract (>= 1.0.0)
61
- ffi (1.0.9)
62
- gherkin (2.4.1)
63
- json (>= 1.4.6)
64
- i18n (0.5.0)
65
- json (1.5.3)
66
- json_pure (1.5.3)
67
- linecache (0.43)
68
- mail (2.2.19)
69
- activesupport (>= 2.3.6)
70
- i18n (>= 0.4.0)
71
- mime-types (~> 1.16)
72
- treetop (~> 1.4.8)
73
- mime-types (1.16)
74
- nokogiri (1.4.6)
75
- polyglot (0.3.1)
76
- rack (1.2.2)
77
- rack-mount (0.6.14)
78
- rack (>= 1.0.0)
79
- rack-test (0.5.7)
80
- rack (>= 1.0)
81
- rails (3.0.7)
82
- actionmailer (= 3.0.7)
83
- actionpack (= 3.0.7)
84
- activerecord (= 3.0.7)
85
- activeresource (= 3.0.7)
86
- activesupport (= 3.0.7)
87
- bundler (~> 1.0)
88
- railties (= 3.0.7)
89
- railties (3.0.7)
90
- actionpack (= 3.0.7)
91
- activesupport (= 3.0.7)
92
- rake (>= 0.8.7)
93
- thor (~> 0.14.4)
94
- rake (0.8.7)
95
- rspec (2.5.0)
96
- rspec-core (~> 2.5.0)
97
- rspec-expectations (~> 2.5.0)
98
- rspec-mocks (~> 2.5.0)
99
- rspec-core (2.5.2)
100
- rspec-expectations (2.5.0)
101
- diff-lcs (~> 1.1.2)
102
- rspec-mocks (2.5.0)
103
- rspec-rails (2.5.0)
104
- actionpack (~> 3.0)
105
- activesupport (~> 3.0)
106
- railties (~> 3.0)
107
- rspec (~> 2.5.0)
108
- ruby-debug (0.10.4)
109
- columnize (>= 0.1)
110
- ruby-debug-base (~> 0.10.4.0)
111
- ruby-debug-base (0.10.4)
112
- linecache (>= 0.3)
113
- rubyzip (0.9.4)
114
- selenium-webdriver (0.2.2)
115
- childprocess (>= 0.1.9)
116
- ffi (>= 1.0.7)
117
- json_pure
118
- rubyzip
119
- sqlite3-ruby (1.2.5)
120
- term-ansicolor (1.0.5)
121
- thor (0.14.6)
122
- treetop (1.4.9)
123
- polyglot (>= 0.3.1)
124
- tzinfo (0.3.27)
125
- xpath (0.1.4)
126
- nokogiri (~> 1.3)
127
-
128
- PLATFORMS
129
- ruby
130
-
131
- DEPENDENCIES
132
- cucumber (~> 1.0.0)
133
- cucumber-rails (~> 1.0.0)
134
- rails (= 3.0.7)
135
- rspec (= 2.5.0)
136
- rspec-rails (= 2.5.0)
137
- ruby-debug (>= 0.10.3)
138
- spork!
139
- sqlite3-ruby (= 1.2.5)