Questions tagged [spork]

A DRb server for testing frameworks (RSpec / Cucumber currently) that forks before each run to ensure a clean testing state.

Spork is Tim Harper’s implementation of test server (similar to the script/spec_server that used to be provided by rspec-rails), except rather than using the Rails constant unloading to reload your files, it forks a copy of the server each time you run your tests. The result? Spork runs more solid: it doesn’t get corrupted over time, it can work with any ruby framework, and it properly handles modules and any voodoo meta programming you may have put in your app.

Spork runs on POSIX systems using fork. It also runs on windows by pre-populating a pool of ready processes (referred to here as the “magazine” strategy).

250 questions
47
votes
3 answers

How to Send RubyMine Notifications to Growl?

I'm trying to figure out how to get RubyMine's console to send messages to growl. Specifically, since I run Rspec & Spork through RubyMine, I'd like to get Growl notifications of how many tests passed & failed. I had the command-line version of this…
D. Simpson
  • 1,862
  • 17
  • 32
25
votes
2 answers

Problems with Guard, Spork, Rspec & Rails 3

I've followed the spork railscast video and it gives me the following error when I try to run guard: Guard is now watching at '/Users/m/work/' Starting Spork for Test::Unit & RSpec Couldn't find a supported test framework that begins with…
Mike Neumegen
  • 2,236
  • 1
  • 22
  • 34
23
votes
4 answers

Getting an uninitialized constant error with RSpec. Have no idea what's causing it

I'm using RSpec for testing and when I left work Friday afternoon, my tests were passing. But when I went home and synced my repository, the tests failed on my laptop. Now back at work, the tests are failing still. Don't believe its my code since…
user338413
  • 659
  • 2
  • 8
  • 19
23
votes
4 answers

Rails 4.0 Spork/ActiveRecord exception

I've been using Michael Hartl's Rails Tutorial to pick up Ruby on Rails and have recently been going through the new Rails 4.0 version of the tutorial. I've encountered an issue with Spork; I know that we're using a custom fork of Spork for Rails…
orenyk
  • 352
  • 4
  • 9
21
votes
5 answers

spork 0.9.2 and rspec 3.0.0 = uninitialized constant RSpec::Core::CommandLine (NameError)

Im using spork 0.9.2 and rspec 3.0.0. When trying to run test rspec --drb I have an exception C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in run_tests: uninitialized constant…
lx00st
  • 1,506
  • 9
  • 17
19
votes
4 answers

Spork: how to refresh validations and other code?

I've been using spork all day, and most of the time it is a really great. However, I am often running into a few problems where I need to restart Spork in order for my tests to pass... and now I'm wondering if it's more trouble than it's worth. I am…
egervari
  • 21,108
  • 30
  • 115
  • 171
18
votes
3 answers

Error on start when using Spork and Guard

Here's the problem. When added the Guard gem everything was fine when I was calling Guard. When I added Spork, I get the following error that doesn't affect testing my tests but it brings it up every time I try to restart Guard. 19:01:28 - INFO -…
PericlesTheo
  • 2,319
  • 2
  • 17
  • 30
16
votes
2 answers

Rspec, shoulda and spork does not work together

when I run rspec spec/models result is OK. But when I use spork, every test where shoulda macros (like it { should validate_presence_of(:title) } is used FAILS with error like: undefined method 'validate_presence_of' for ... I use: rails…
boblin
  • 3,411
  • 4
  • 22
  • 28
14
votes
1 answer

Rails 4.1 - Why Spring?

Now with Spring built-in with rails 4.1, I am curious about why the dev-team chose Spring over the others (Zeus and Spork). Why did they choose Spring?
karlingen
  • 11,886
  • 5
  • 37
  • 65
13
votes
3 answers

Spork and cache_classes problem with rspec, factory_girl and datamapper

I've got a problem with Spork test server. If I set config.cache_classes = false in config/environments/test.rb then specs start to rasie errors. Failure/Error: task = Factory(:something, :foo => @foo, :bar => @bar) …
sparrovv
  • 5,684
  • 2
  • 25
  • 30
13
votes
4 answers

Spork.prefork is loading app/models/*

I can not figure out how to get spork not to load all of my app models. Testing changes to my models is greatly slowed down as I am unable to use spork to help. This is what I get when I debug what spork is loading: - Spork Diagnosis - --…
Sean McCleary
  • 3,470
  • 3
  • 28
  • 43
13
votes
2 answers

save_and_open_page and spork, spork is loosing test suite / output

When i run my rspec tests with spork, every time i use capybara's save_and_open_page, spork is loosing the test suite.. or maybe doesnt output anything anymore... See the log # => without save_and_open_page 09:04:24 - INFO - Spork server for RSpec,…
BvuRVKyUVlViVIc7
  • 11,200
  • 8
  • 55
  • 105
11
votes
3 answers

How to combine autotest and spork in Rails testing?

Autotest increases the speed at which tests run by running only the changed tests. But I want to push it even further by using spork to preload the Rails environment, so that I will get even faster feedback. Is this possible? Autotest :…
user
  • 359
  • 4
  • 13
11
votes
7 answers

Spork doesn't reload code

I am using following gems and ruby-1.9.3-p194: rails 3.2.3 rspec-rails 2.9.0 spork 1.0.0rc2 guard-spork 0.6.1 Full list of used gems is available in this Gemfile.lock or Gemfile. And I am using this configuration…
nothing-special-here
  • 8,238
  • 10
  • 56
  • 90
10
votes
4 answers

Can spork work with rake tasks?

Rake tasks suffer from the same problem as running tests: the Rails bootup process takes a long time before the task is even running. Is there a way to integrate spork and rake together?
matthuhiggins
  • 1,855
  • 1
  • 12
  • 13
1
2 3
16 17