spork 0.9.0-x86-mingw32 → 1.0.0rc0-x86-mingw32

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.
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.rb +3 -10
  9. data/lib/spork/app_framework.rb +16 -30
  10. data/lib/spork/app_framework/unknown.rb +5 -1
  11. data/lib/spork/runner.rb +1 -1
  12. data/lib/spork/test/cucumber_helpers.rb +5 -0
  13. data/lib/spork/test/test_helpers.rb +2 -0
  14. data/lib/spork/test_framework.rb +9 -9
  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
@@ -3,4 +3,8 @@ class Spork::AppFramework::Unknown < Spork::AppFramework
3
3
  def entry_point
4
4
  nil
5
5
  end
6
- end
6
+
7
+ def self.present?
8
+ false
9
+ end
10
+ end
@@ -56,7 +56,7 @@ module Spork
56
56
  def run
57
57
  return false unless test_framework = find_test_framework
58
58
  ENV["DRB"] = 'true'
59
- @error.puts "Using #{test_framework.short_name}"
59
+ @error.puts "Using #{test_framework.short_name}, #{test_framework.app_framework.short_name}"
60
60
  @error.flush
61
61
 
62
62
  case
@@ -0,0 +1,5 @@
1
+ SPORK_CUCUMBER_DIR = File.expand_path( "../../../features/", File.dirname(__FILE__))
2
+ require("#{SPORK_CUCUMBER_DIR}/support/background_job.rb")
3
+ require("#{SPORK_CUCUMBER_DIR}/support/spork_world.rb")
4
+ require("#{SPORK_CUCUMBER_DIR}/support/bundler_helpers.rb")
5
+ Dir.glob("#{SPORK_CUCUMBER_DIR}/steps/**/*.rb").each { |f| load f }
@@ -0,0 +1,2 @@
1
+ SPORK_SPEC_DIR = File.expand_path( "../../../spec/", File.dirname(__FILE__))
2
+ Dir.glob("#{SPORK_SPEC_DIR}/support/*.rb").each { |f| require(f) }
@@ -122,16 +122,16 @@ class Spork::TestFramework
122
122
  stderr.puts "#{helper_file} has not been bootstrapped. Run spork --bootstrap to do so."
123
123
  stderr.flush
124
124
 
125
- if framework.bootstrap_required?
126
- stderr.puts "I can't do anything for you by default for the framework you're using: #{framework.short_name}.\nYou must bootstrap #{helper_file} to continue."
125
+ if app_framework.bootstrap_required?
126
+ stderr.puts "I can't do anything for you by default for the app framework you're using: #{app_framework.short_name}.\nYou must bootstrap #{helper_file} to continue."
127
127
  stderr.flush
128
128
  return false
129
129
  else
130
- load(framework.entry_point)
130
+ load(app_framework.entry_point)
131
131
  end
132
132
  end
133
133
 
134
- framework.preload do
134
+ app_framework.preload do
135
135
  if bootstrapped?
136
136
  stderr.puts "Loading Spork.prefork block..."
137
137
  stderr.flush
@@ -147,21 +147,21 @@ class Spork::TestFramework
147
147
  end
148
148
 
149
149
  def entry_point
150
- bootstrapped? ? helper_file : framework.entry_point
150
+ bootstrapped? ? helper_file : app_framework.entry_point
151
151
  end
152
152
 
153
153
  def default_port
154
154
  self.class.default_port
155
155
  end
156
156
 
157
+ def app_framework
158
+ @app_framework ||= Spork::AppFramework.detect_framework
159
+ end
160
+
157
161
  protected
158
162
  def self.inherited(subclass)
159
163
  @@supported_test_frameworks << subclass
160
164
  end
161
-
162
- def framework
163
- @framework ||= Spork::AppFramework.detect_framework
164
- end
165
165
  end
166
166
 
167
167
  Spork.detect_and_require('spork/test_framework/*.rb')
@@ -6,102 +6,21 @@ require 'stringio'
6
6
  require 'fileutils'
7
7
  require 'rspec'
8
8
 
9
+ Dir.glob("#{File.dirname(__FILE__)}/support/*.rb").each { |f| require(f) }
10
+
9
11
  RSpec.configure do |config|
12
+ include(TmpProjectHelpers)
13
+
10
14
  config.before(:each) do
11
- $test_stdout = StringIO.new
12
- $test_stderr = StringIO.new
15
+ TestIOStreams.set_streams(StringIO.new, StringIO.new)
16
+
13
17
  @current_dir = nil
14
- end
15
-
16
- config.after(:each) do
17
- FileUtils.rm_rf(SPEC_TMP_DIR) if File.directory?(SPEC_TMP_DIR)
18
- end
19
- end
20
-
21
- def create_file(filename, contents)
22
- FileUtils.mkdir_p(SPEC_TMP_DIR) unless File.directory?(SPEC_TMP_DIR)
23
-
24
- in_current_dir do
25
- FileUtils.mkdir_p(File.dirname(filename))
26
- File.open(filename, 'wb') { |f| f << contents }
18
+ clear_tmp_dir
27
19
  end
28
20
  end
29
21
 
30
- def create_helper_file(test_framework = FakeFramework)
31
- create_file(test_framework.helper_file, "# stub spec helper file")
32
- end
33
-
34
- def in_current_dir(&block)
35
- Dir.chdir(current_dir, &block)
36
- end
37
-
38
- def current_dir
39
- @current_dir ||= SPEC_TMP_DIR
40
- end
41
-
42
- def change_current_dir(sub_path)
43
- @current_dir = File.expand_path(sub_path, SPEC_TMP_DIR)
44
- end
45
22
 
46
23
  def windows?
47
24
  ENV['OS'] == 'Windows_NT'
48
25
  end
49
26
 
50
-
51
- module RSpec
52
- module Matchers
53
- class IncludeAStringLike
54
- def initialize(substring_or_regex)
55
- case substring_or_regex
56
- when String
57
- @regex = Regexp.new(Regexp.escape(substring_or_regex))
58
- when Regexp
59
- @regex = substring_or_regex
60
- else
61
- raise ArgumentError, "don't know what to do with the #{substring_or_regex.class} you provided"
62
- end
63
- end
64
-
65
- def matches?(list_of_strings)
66
- @list_of_strings = list_of_strings
67
- @list_of_strings.any? { |s| s =~ @regex }
68
- end
69
- def failure_message
70
- "#{@list_of_strings.inspect} expected to include a string like #{@regex.inspect}"
71
- end
72
- def negative_failure_message
73
- "#{@list_of_strings.inspect} expected to not include a string like #{@regex.inspect}, but did"
74
- end
75
- end
76
-
77
- def include_a_string_like(substring_or_regex)
78
- IncludeAStringLike.new(substring_or_regex)
79
- end
80
- end
81
- end
82
-
83
- module Spork::TestIOStreams
84
- def self.included(klass)
85
- klass.send(:extend, ::Spork::TestIOStreams::ClassMethods)
86
- end
87
-
88
- def stderr
89
- self.class.stderr
90
- end
91
-
92
- def stdout
93
- self.class.stdout
94
- end
95
-
96
- module ClassMethods
97
- def stderr
98
- $test_stderr
99
- end
100
-
101
- def stdout
102
- $test_stdout
103
- end
104
- end
105
- end
106
-
107
- Dir.glob(File.dirname(__FILE__) + "/support/*.rb").each { |f| require(f) }
@@ -2,13 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Spork::AppFramework do
4
4
  describe ".detect_framework" do
5
- it "detects when rails is installed and available" do
6
- create_file("config/environment.rb", "RAILS_GEM_VERSION = '2.1.0'")
7
- in_current_dir do
8
- Spork::AppFramework.detect_framework.short_name.should == "Rails"
9
- end
10
- end
11
-
12
5
  it "returns Unknown when no framework known detected" do
13
6
  Spork::AppFramework.detect_framework.short_name.should == "Unknown"
14
7
  end
@@ -1,6 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
-
4
3
  describe Spork::Diagnoser do
5
4
  after(:each) do
6
5
  Spork::Diagnoser.remove_hook!
@@ -66,9 +66,9 @@ describe Spork::TestFramework do
66
66
  create_helper_file
67
67
  @fake.bootstrap
68
68
 
69
- $test_stderr.string.should include("Bootstrapping")
70
- $test_stderr.string.should include("Edit")
71
- $test_stderr.string.should include("favorite text editor")
69
+ TestIOStreams.stderr.string.should include("Bootstrapping")
70
+ TestIOStreams.stderr.string.should include("Edit")
71
+ TestIOStreams.stderr.string.should include("favorite text editor")
72
72
 
73
73
  File.read(@fake.helper_file).should include(File.read(FakeFramework::BOOTSTRAP_FILE))
74
74
  end
@@ -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-mingw32
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: &70323225463580 !ruby/object:Gem::Requirement
17
+ requirement: &70238246815340 !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: *70323225463580
25
+ version_requirements: *70238246815340
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: -1185783682866595048
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: