sporkrb / spork Goto Github PK
View Code? Open in Web Editor NEWA DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
Home Page: spork.rubyforge.org
License: MIT License
A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.
Home Page: spork.rubyforge.org
License: MIT License
It seems at_exit does not work with Cucumber+Spork (see discussion at http://groups.google.com/group/cukes/browse_thread/thread/8801396bc3a888e7?hl=en).
Instead if spork had a between_run hook, I could run teardown stuff there instead of at_exit.
As the title says, each time spec command throws some kind of exception, spork will close down.
For example, trying to run something like:
spec non_existent_file.rb
throws the expected 'file not found' error, and in the spork window I get:
Spork is ready and listening on 8989!
/var/lib/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/forker.rb:42:in `load': end of file reached (EOFError)
from /var/lib/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/forker.rb:42:in`result'
from /var/lib/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/forker.rb:40:in `initialize'
from /var/lib/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/forker.rb:40:in`new'
from /var/lib/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/forker.rb:40:in `result'
from /var/lib/gems/1.8/gems/spork-0.7.5/lib/spork/run_strategy/forking.rb:15:in`run'
I'm using:
spork (0.7.5)
rspec (1.3.0)
rspec-rails (1.3.2)
rails (2.3.5)
Automatically starts spork and autospec afterwards with:
$ sudo gem install timcharper-spork --source http://gems.github.com
ERROR: could not find gem timcharper-spork locally or in a repository
http://hasmygembuiltyet.org/timcharper/spork
I was able to install it locally by cloning and then I found the culprit in the gemspec. Seems you can't use things like Dir['lib/*/.rb'] when running with the SAFE level at 3 like github does.
Here's my patch
http://github.com/scudco/spork/commit/c31c8ea83da1ca2acc3fc74bd59c91aeca2dcde4
And so changes you make in you views after spork is loaded are not hooked up.
config.action_view.cache_template_loading should be set to "false" in confing/environments/test.rb (and config/environments/cucumber.rb if you have that).
Maybe the instruction should be added to the README.
I could not get Spork to run after a fresh install of Ruby 1.9.2 + gem 1.3.7 on Win7 x64.
The error message was:
Using RSpec
-- Rinda Ring Server listening for connections...
-- Starting to fill pool...
Wait until at least one slave is provided before running tests...
** CTRL+BREAK to stop Spork and kill all ruby slave processes **
Spork is ready and listening on 8989!
:29:in `require': no such file to load -- magazine_slave (LoadError)
from :29:in `require'
from magazine_slave_provider.rb:5:in `'
:29:in `require': no such file to load -- magazine_slave (LoadError)
from :29:in `require'
from magazine_slave_provider.rb:5:in `'
Then found the following workaround:
In lib/spork/run_strategy/magazine/magazine_slave_provider.rb on line 5 change:
require 'magazine_slave'
to:
require './magazine_slave.rb'
I don't call it a patch because I don't think it is an issue related to Spork. It is more likely a rubygems problem. However I hope this workaround will help someone with the same problem.
does anyone out there use haml with spork?
we recently converted our project to use haml and now when we run tests with spork, every test fails with something like the following:
ActionView::TemplateError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
On line #67 of app/views/layouts/application.html.haml
64:
65: #search_wrap{:class => %Q!#{controller.controller_name}_#{controller.action_name}!}
66: .container
67: - form_tag({:controller => 'products', :action => 'search', :protocol => 'http://', :only_path => false}, {:method => 'get', :id => 'sform'}) do
68: %h2
69: %label{:for => 'search_field', :title => 'Find'} Find:
It seems that anywhere we use form_tag in our views we get that error, doesn't seem to matter what is in form_tag either. It will throw the error with no parameters as well.
Any help would be appreciated.
Thanks!
Chris
Hi Tim, very happy to see the 0.9.0.rc gem!
I got this exception when running my spec (2.0.0.beta.22) with --drb (without spec running fine):
Exception encountered: #<ActiveRecord::AdapterNotSpecified: test database is not configured>
backtrace:
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/app_framework/rails.rb:57:in `preload_rails'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `call'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `exec_each_run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `each'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `exec_each_run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:12:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:21:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:18:in `fork'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:18:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:47:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `__send__'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `perform_without_block'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1518:in `perform'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1592:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1433:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1350:in `initialize'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `new'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `start_service'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:29:in `listen'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:20:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork/runner.rb:76:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork/runner.rb:10:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/spork:10
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19:in `load'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19
Here my spork --d:
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
- Spork Diagnosis -
-- Summary --
config/application.rb
config/boot.rb
spec/spec_helper.rb
-- Detail --
--- config/application.rb ---
--- config/boot.rb ---
--- spec/spec_helper.rb ---
Any ideas? Thanks!
While doing some work on Spork I noticed that to run all the features (which I'm having trouble with - separate problem though) you have to install a lot of gems. Something like a rake task, or possibly a Bundler Gemfile would make it quicker to get up and running. This is also convenient if (like me) you use rvm, and occasionally bomb a gemset if general weirdness occurs.
When I run spork --help I get:
Usage: spork [test framework name] [options]
Options:
-b, --bootstrap
-d, --diagnose
-h, --help
-p, --port [PORT]
uninitialized constant Spork::Runner::StringIO (NameError)
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.8.4/bin/../lib/spork/runner.rb:38:in `supported_test_frameworks_text'
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.8.4/bin/../lib/spork/runner.rb:32:in `initialize'
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.8.4/bin/../lib/spork/runner.rb:9:in `new'
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.8.4/bin/../lib/spork/runner.rb:9:in `run'
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.8.4/bin/spork:10
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19:in `load'
/Users/andrew/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19
Back in Rails 2.1 days spork was blazing fast, but now at 2.3 after the initial spec_helper.rb load there is a waiting period of around 8-10 seconds, (environent.rb is not loaded again, I checked with some puts here and there).
The current loading looks something like this(found out with puts-ing everywhere...):
spec_helper:start -- prefork -- spec_helper:end -- 8-10seconds wait -- each_run -- each_run -- spec_helper:start -- spec_helper:end
Do you have any idea how I could find out where this time is spent ?
I've had an adapter for Padrino (a new framework based on Sinatra) that I've been using for a while now without any problems. So I thought I'd share it to see if it garnered enough attention to put in core.
It'll be great to have an idea of what you put inside Spork.prefork and Spork.each_run blocks in your spec_helper.rb, can you give an example, please? Thanks!
I'm actually using the milhouse-spork gem, but it looks like that's been merge back in with the main branch so I'll post this here.
When running my specs with spork, my ApplicationController wasn't being loaded properly. After digging around expanded_caller in lib/spork.rb wasn't parsing caller line's properly because on Windows, the line include the disk name where the file lives (i.e. C:/foo/bar.rb:13:something else...) and it looks like the code assumes only the colons around the line number.
As a quick fix I just changed the split to split on a different regex. I only have a windows machine to test on, but I think this should keep *nix machines happy too.
And here's a diff: http://gist.github.com/325480
STUPID! Rails seems to default to environments/test.rb having:
config.cache_classes = true
which then causes Rails to "automatically" pre-load all models. Which causes them to NOT get updated for each spork block.
Thought I'd mention this in case anyone else had this problem.
I get the following error from spork:
Expected spork-0.8.4/lib/spork/app_framework/rails_stub_files/application.rb to define Application (LoadError)
Yes, I've got a model named Application. I fixed the problem by deleting the file. If you ever drop rails 2.2 support, it'd be nice if you did as well.
Hello,
Please add some screen activity when the spork is used.
How could I be sure if my autotest is using spork?
Maybe there is already such an option which I can enable?
ApplicationController is preloaded by spork by this file:
Unfortunately, my ApplicationController doesn't descend directly from ActionController::Base
http://gist.github.com/165273
http://gist.github.com/165274
This is causing a superclass mismatch when I load spork + try to run specs:
http://gist.github.com/39871732f9a02cf84bcc.
I'm not sure what the idea fix here is - Do we remove the stub (and cause ApplicationController to be loaded automatically in the prefork block), or do we parse application.rb, and load up any other descendent classes?
A middle ground might be this: if your application descends directly from ActionController::Base, preload the stub, otherwise, load the real file.
I'm currently playing with getting spork working for a merb app we're working on - I'm pretty sure i've managed to split up the bootloading process of merb into prefork and each_run.
However, i'm running into a problem that appears to be mostly unrelated to merb. Here's the flow as I follow it:
spork rspec (starts spork server)
autospec
I'm not quite sure why no-one else is running into this issue (or at least, no-one seems to be running into it and posting anything about it on the internet)
I'm probably going to work around the problem using a slightly messy hack for the moment, but I'm unsure what would be a good clean way to fix this.
There is a wonderful gem call test_notifer (http://github.com/fnando/
test_notifier) that gives you desktop notifications of the results
when your tests complete (so you don't have to look at the
terminal).
Unfortunately, spork and test_notifer don't seem to play nice together
when running rspec (I haven't tried it with other frameworks). If you
require test_notifer/rspec in spec helper everything works great when
spork isn't running but if you try to run spork you get the follow
errors:
undefined method map' for nil:NilClass (NoMethodError) /usr/local/lib/site_ruby/1.8/rubygems.rb:270:in
activate'
/usr/local/lib/site_ruby/1.8/rubygems.rb:296:in activate' /usr/local/lib/site_ruby/1.8/rubygems.rb:295:in
each'
/usr/local/lib/site_ruby/1.8/rubygems.rb:295:in activate' /usr/local/lib/site_ruby/1.8/rubygems.rb:296:in
activate'
/usr/local/lib/site_ruby/1.8/rubygems.rb:295:in each' /usr/local/lib/site_ruby/1.8/rubygems.rb:295:in
activate'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:35:in
require' /path_to_rails_app/spec/spec_helper.rb:4 /usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/test_framework.rb: 138:in
load'
/usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/test_framework.rb:
138:in preload' /usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/app_framework/ rails.rb:121:in
preload'
/usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/test_framework.rb:
134:in preload' /usr/lib/ruby/gems/1.8/gems/spork-0.7.5/bin/../lib/spork.rb:57:in
exec_prefork'
/usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/test_framework.rb:
120:in preload' /usr/lib/ruby/gems/1.8/gems/spork-0.7.5/lib/spork/run_strategy/ forking.rb:23:in
preload'
/usr/lib/ruby/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/runner.rb:
74:in run' /usr/lib/ruby/gems/1.8/gems/spork-0.7.5/bin/../lib/spork/runner.rb: 9:in
run'
/usr/lib/ruby/gems/1.8/gems/spork-0.7.5/bin/spork:10
/usr/bin/spork:19:in `load'
/usr/bin/spork:19
FYI
I wanted to run the test on my rvm installed version of 1.9.2-head and needed to specify that under ruby_19 the gem ruby-debug19 should be installed instead of ruby-debug.
Bundler 1.0 supports specifying platform gem dependencies like this:
platforms :ruby_19 do
gem 'ruby-debug19'
end
platforms :ruby_18 do
gem 'ruby-debug'
end
See comments in this issue for a bit more info: http://github.com/carlhuda/bundler/issues/#issue/426
The 1.0 version is still prerelease so you need to install it like this:
gem install bundler --pre
Unfortunately ruby-debug19 needs to be passed a path to where the active ruby is:
gem install ruby-debug19 -- --with-ruby-include=/Users/stephen/.rvm/src/ruby-1.9.2-head/
See this comment: http://github.com/carlhuda/bundler/issues/#issue/23/comment/311834
When I installed ruby-debug19 manually the command 'bundle install' completed successfully.
I just got rspec-2 working with spork and rails-3. I haven't had a chance to investigate why yet, but with this configuration we need to set config.cache_classes = false to get models to reload. This suggests that rails is eager loading models during the prefork (which in my case is not asking to load anything under app). Something we can manage from spork?
It would be great to able to launch spork as deamon :-)
https://gist.github.com/102375ce52b5048e53a2 -- gem list I'm using
App is almost fresh with minimal changes.
Spork traps EagerPath's load!, which is required to render a 401 page to test role_requirement's ability to lock out people. Has this happened to anyone else? For now I'll monkeypatch..
Fix uninitialized constant StringIO (NameError)
Fix is here http://github.com/MSch/spork/commit/8684caa18c145eed85833244bac9efae8ed42ae8
Hi,
first of all, I'm not sure, cause I use spork-Millhouse fork on windows. I use it with Cucumber. As windows console default encoding is 866 while I write Cucumber scenarios in UTF-8, to get proper text in console output I have to use encoding translation which is built-in Cucumber. I set up CUCUMBER_OUTPUT_ENCODING, and the translation perfectly works when Cucumber starts rails by its own, but when I tell it to use spork test server( --drb), then I get ugly texts printed out to console. It seems like built-in Cucumber encoding translation has been somehow switched off by spork.
Cause I have no linux, I can not check out whether that bug relates only to Millhouse's fork, or to yours one too.
Grate tool anyway! Thank you!
Vote if you'd like Spork to support Micronaut (and Micronaut to support running tests over drb)
If I use a custom helper method in a view spork generates an error because this helper method is unknown. If the method is in a controller helper (app/helpers/items_helper.rb in my example) everything is okay.
I put an example on github: http://github.com/JerryWho/test
If rake spec is run without spork all tests pass. But with spork an error occurs:
ActionView::TemplateError in '/items/index.html.erb renders a list of items'
undefined method `simpleFunction' for #ActionView::Base:0x243ca54
In tmp/rails-debug.log I write the loaded files. app/helpers/simple_helper.rb appears. app/helpers/items_helper.rb also appears.
System: Win XP Pro SP3
Ruby: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
Gems:
rspec (1.3.0)
spork (0.8.1)
win32-api (1.4.6)
win32-process (0.6.2)
C:\Dev\apps\win\dde>spork
Using RSpec
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/win32-api-1.4.6-x86-mingw32/lib/win32/api.so: [BUG] Segmentation fault
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
-- control frame ----------
c:0027 p:-5020060 s:0078 b:0078 l:000077 d:000077 TOP
c:0026 p:---- s:0076 b:0076 l:000075 d:000075 CFUNC :require
c:0025 p:0011 s:0072 b:0072 l:000071 d:000071 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:1
c:0024 p:---- s:0070 b:0070 l:000069 d:000069 FINISH
c:0023 p:---- s:0068 b:0068 l:000067 d:000067 CFUNC :require
c:0022 p:0011 s:0064 b:0064 l:000063 d:000063 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-pr-1.0.9/lib/windows/error.rb:12
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 FINISH
c:0020 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :require
c:0019 p:0011 s:0056 b:0056 l:000055 d:000055 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/win32-process-0.6.2/lib/win32/process.rb:1
c:0018 p:---- s:0054 b:0054 l:000053 d:000053 FINISH
c:0017 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :require
c:0016 p:0047 s:0048 b:0048 l:000047 d:000047 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy/magazine.rb:6
c:0015 p:---- s:0046 b:0046 l:000045 d:000045 FINISH
c:0014 p:---- s:0044 b:0044 l:000043 d:000043 CFUNC :require
c:0013 p:0012 s:0040 b:0040 l:000031 d:000039 BLOCK C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44
c:0012 p:---- s:0037 b:0037 l:000036 d:000036 FINISH
c:0011 p:---- s:0035 b:0035 l:000034 d:000034 CFUNC :each
c:0010 p:0049 s:0032 b:0032 l:000031 d:000031 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44
c:0009 p:---- s:0030 b:0030 l:000029 d:000029 FINISH
c:0008 p:0133 s:0028 b:0028 l:000027 d:000027 METHOD C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/runner.rb:73
c:0007 p:0023 s:0023 b:0023 l:000022 d:000022 METHOD C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/runner.rb:9
c:0006 p:0133 s:0017 b:0017 l:000016 d:000016 TOP C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/bin/spork:10
c:0005 p:---- s:0013 b:0013 l:000012 d:000012 FINISH
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :load
c:0003 p:0127 s:0007 b:0007 l:001044 d:001ed8 EVAL C:/Dev/ruby/bin/spork:19
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
-- Ruby level backtrace information-----------------------------------------
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:1:in require' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:1:in
<top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-pr-1.0.9/lib/windows/error.rb:12:in require' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/windows-pr-1.0.9/lib/windows/error.rb:12:in
<top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/win32-process-0.6.2/lib/win32/process.rb:1:in require' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/win32-process-0.6.2/lib/win32/process.rb:1:in
<top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy/magazine.rb:6:in require' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy/magazine.rb:6:in
<top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44:in require' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44:in
block in <top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44:in each' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/run_strategy.rb:44:in
<top (required)>'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/runner.rb:73:in run' C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/lib/spork/runner.rb:9:in
run'
C:/Dev/ruby/lib/ruby/gems/1.9.1/gems/spork-0.8.1/bin/spork:10:in <top (required)>' C:/Dev/ruby/bin/spork:19:in
load'
C:/Dev/ruby/bin/spork:19:in `
[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
see http://gist.github.com/475756
Maybe this a rubygems failure though...not immediately clear.
I'm currently trying to get RSpec 2 and Spork working together. RSpec 2 currently lacks support for DRb, so that must be sorted first, which I'm working on: http://github.com/rspec/rspec-core/issues/issue/2
However, the architecture of RSpec 2 has changed in a way that makes the current interface to RSpec inappropriate. (Extract below.)
def run_tests(argv, stderr, stdout)
::Spec::Runner::CommandLine.run(
::Spec::Runner::OptionParser.parse(
argv,
stderr,
stdout
)
)
end
I could implement ::Spec::Runner::CommandLine
etc as an adapter in RSpec 2, but that would be a kludge.
I noticed that the TestFramework
hierarchy is OCP-conformant, but with two limitations: it's only conformant with respect to helper file detection, and you can't (AFAICT) get Spork to load TestFramework
subclasses from other gems before it runs the detection code. (If the second situation was possible, I could implement the Spork::TestFramework::RSpec2
inside RSpec 2 itself without forking Spork.)
My plan is to extend open the hierarchy to allow detection based secondarily on helper file contents, as you can figure out which version of RSpec is in use based on require lines (require 'spec'
vs require 'rspec/core'
).
I still need to figure out the most correct interface to expose in RSpec 2 for the new adapter to communicate with - so I'll possibly invalidate some of this discussion, but I though I'd put this up as a brain dump.
Let me know if you have any thoughts! Cheers - Ash
This makes it a bit harder then needed to run the specs and features locally. It would be nice to add it back in the next release.
Lots of people still use it. Vote for this if you'd like to see Test::Unit support for Spork.
If you run spork in a project where it has not been bootstrapped yet:
I can't do anything for you by default for the framework your using: Unknown.
You must bootstrap ~/Dropbox/SeniorProject/SPScaffold/spec/spec_helper.rb to continue.
Should be
I can't do anything for you by default for the framework you're using: Unknown.
You must bootstrap ~/Dropbox/SeniorProject/SPScaffold/spec/spec_helper.rb to continue.
Found an issue today: Running spork --diagnose
against an app that loads Bundler on boot (I'm using Padrino here but I imagine the same thing would happen under Rails 3) will die with "private method 'require' called for Bundler:Module". This is because when Spork::Diagnoser overrides Kernel#require, it doesn't mark the new method as private, so Bundler.require ends up getting overridden (or something). Backtrace below:
elliot@excalibur:~/code/github/mine/moolah$ ~/code/github/forks/spork/bin/spork --diagnose
Using RSpec
Loading Spork.prefork block...
Booting Padrino...
private method `require' called for Bundler:Module (NoMethodError)
/Users/elliot/code/github/mine/moolah/config/boot.rb:24
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require_without_diagnoser'
/Users/elliot/code/github/forks/spork/lib/spork/diagnoser.rb:31:in `require'
/Users/elliot/code/github/mine/moolah/spec/spec_helper.rb:19
/Users/elliot/code/github/forks/spork/bin/../lib/spork.rb:23:in `prefork'
/Users/elliot/code/github/mine/moolah/spec/spec_helper.rb:14
/Users/elliot/code/github/forks/spork/lib/spork/diagnoser.rb:36:in `load_without_diagnoser'
/Users/elliot/code/github/forks/spork/lib/spork/diagnoser.rb:36:in `load'
/Users/elliot/code/github/forks/spork/lib/spork/test_framework.rb:138:in `preload'
/Users/elliot/code/github/forks/spork/lib/spork/app_framework.rb:61:in `preload'
/Users/elliot/code/github/forks/spork/lib/spork/test_framework.rb:134:in `preload'
/Users/elliot/code/github/forks/spork/bin/../lib/spork.rb:67:in `exec_prefork'
/Users/elliot/code/github/forks/spork/lib/spork/test_framework.rb:120:in `preload'
/Users/elliot/code/github/forks/spork/lib/spork/runner.rb:68:in `run'
/Users/elliot/code/github/forks/spork/lib/spork/runner.rb:9:in `run'
/Users/elliot/code/github/forks/spork/bin/spork:10
I fixed it and made a topic branch here: http://github.com/mcmire/spork/tree/diagnoser_bundler_compatibility. Thanks!
It would be very helpful if you could programmatically tell spork to reload. My use case is within autotest. When certain files change the entire environment needs to be reloaded. I'd like to be able to tell spork to reload from within my autotest mapping hooks. This could be done by sending a signal to the spork process or maybe connecting to the DRB server.
Environment: Rails 3, Cucumber, Spork, Machinist
No blueprint for class Sponsor (RuntimeError)
./features/sponsors/step_definitions/index_steps.rb:2:in /^I have a sponsor$/' features/schools/outreach/email.feature:8:in
And I have a sponsor'
Sponsor.blueprint do
end
This happens AFTER the first step in a Cucumber scenario has run. In other words, the first step runs fine with Sponsor.blueprint, but on the second, spork seems to have forgotten that Sponsor.blueprint was ever defined in blueprint.rb. I've attempted to "load()" it each time in the Spork.each_run block, but it makes no difference.
Any ideas? Thanks!!
INTERNAL ERROR!!! wrong argument type DRb::DRbObject (expected File)
/Library/Ruby/Gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:112:in readline' /Library/Ruby/Gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:112:in
readline'
/Library/Ruby/Gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/interface.rb:62:in read_command' /Library/Ruby/Gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:246:in
process_commands'
/Library/Ruby/Gems/1.8/gems/ruby-debug-0.10.3/cli/ruby-debug/processor.rb:171:in __at_line' (eval):5:in
at_line'
(eval):3:in synchronize' (eval):3:in
at_line'
/Library/Ruby/Gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby-debug-base.rb:54:in at_line' ./spec/views/designs/new.html.haml_spec.rb:28 /Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/assertions/selector_assertions.rb:309:in
assert_select'
[trimmed]
Hello,
Spork is not reloading nested models which change.
For example
app/models/customer.rb
app/models/customer/subscriptions.rb
Both are loaded fine, but any changes to the files are not reflected. Is there work around? If not I can put together a sample demonstrating the issue.
My spec_helper.rb http://gist.github.com/286048
spork (0.7.5)
rspec (1.3.0)
rspec-rails (1.3.2)
Thanks - JW
Vote for this if you'd like to see Spork run on windows
Hello,
Spork is not reloading nested models which change.
For example
app/models/customer.rb
app/models/customer/subscriptions.rb
Both are loaded fine, but any changes to the files are not reflected. Is there work around? If not I can put together a sample demonstrating the issue.
My spec_helper.rb http://gist.github.com/286048
spork (0.7.5)
rspec (1.3.0)
rspec-rails (1.3.2)
Thanks - JW
Hello, I'm trying out spork (0.9.0.rc2) with a brand new rails (3.0.0) app. I'm unable to make spork to reload files/classes. Once spork is launched, controllers, models, routes or specs are no longer reloaded. I've read all related issues here and tried all possible workarounds but nothing seems to work. Can you please provide up to date information about the status of reloading?
One of the things I've found very confusing as I've begun to use Spork is knowing where to put my Spec::Runner code. It'd be nice if the feature file for RSpec showed a more complete example file. As it stands things are pretty skimpy.
after upgrading from 0.7.3 to 0.7.4, I now get the following warning when I start up the spork server:
/Library/Ruby/Gems/1.8/gems/spork-0.7.4/bin/../lib/spork/app_framework.rb:8: warning: already initialized constant SUPPORTED_FRAMEWORKS
Doesn't seem to affect anything though.
Spork will work with Merb already, but doesn't quite have the "out of the box" experience that rails does (Spork automatically hooks in to Rails to make a lot of things just work by default, like preventing your ApplicationController, views, and models from being cached).
Rails determines whether or not a frozen gem (more specifically: it's extensions) has been built by checking for the existance of a Makefile in the extension's directory. Spork however doesn't create one and Rails thus always thinks the frozen gem hasn't been built yet.
I'd suggest to create a dummy Make- instead of Rakefile to remedy this.
Imagine, I've got to trap Spec::Runner's .configure method. It takes a block whose execution I need to delay. But as of now, spork (I've got 0.8.1) doesn't resend blocks.
As far as I can see, it's not that hard to implement block resending, I could even do it myself if needed, although I'm not that familiar with spork internals to say it'll go without consequences.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.