sporkrb / spork-rails Goto Github PK
View Code? Open in Web Editor NEWSpork plugin for rails
License: MIT License
Spork plugin for rails
License: MIT License
Just wondering.
This might be what I need to drop everything and just upgrade. :-)
I'm running some tests with Cucumber through spork with spork-rails 3.2.0 and spork 1.0.0rc2 and I cannot get my helper methods to be loaded.
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
3.0.12
Everything is fine when:
I'm using many gems (Devise, FactoryGirl, Mongoid - also using ActiveRecord), but not ActiveAdmin. I say this because this issue is like the issue #109 on spork. Nothing from this issue could help me, and now that spork-rails
has been extracted, it seemed to me the issue belonged here.
Here is a gist of my configuration. For now, I will be running my features without Spork...
Hey guys
I'm running spork for some time now with Rails, and stumbled over spork-rails now. Should I change to spork-rails? What exactly does it for Rails?
Thanks,
Josh
After installing spork-rails I get this error when running 'spork':
Andrews-Mac-Pro-4:lb_final chapmanf16$ spork
/Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in load': cannot load such file -- /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/gems/spork-1.0.0rc3/bin/spork (LoadError) from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in
eval' from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in
'
If I run 'sudo spork' none of my gems are being located. I will get the following errors:
Using RSpec, Rails
Preloading Rails environment
Could not find actionpack-4.0.0 in any of the sources
It literally can't find any of them. I have only started learning ruby/rails for the past 3 days so I'm completely out of my element, but I am really not sure what to do. Any help would be appreciated.
Thanks.
RSpec::Core::CommandLine
with an array of options is deprecated. Use Instantiate a RSpec::Core::Runner
with a RSpec::Core::ConfigurationOptions
instance instead. Called from ~/.rvm/gems/ruby-2.1.2/gems/spork-1.0.0rc4/lib/spork/test_framework/rspec.rb:11Please reopen issue #6
Tried setting up, but for some reason the files weren't loading properly. I installed everything just as before and included the Spork prefork in the rails_helper.rb
file since spec_helper.rb
doesn't have anything anymore (at least mine doesn't).
Anyone else have any issues with this?
Hi Tim,
I'm using ruby 1.9.2-p290 (+ rvm + gemset) and rails 3.1.3 (+ bundler) for this app (created for rspec so no test folder is present) on Ubuntu 10.04 .
I just tried to install my development-and-test-gem-group containing
When i now try to bootstrap my spec_helper.rb file as stated in the documentation (either with or without bundle exec) i get the following error message in my terminal:
bla@bla:~/Aptana Studio 3 Workspace/appname$ bundle exec spork rspec --bootstrap
Using RSpec, Rails
Bootstrapping /bla/Aptana Studio 3 Workspace/appname/spec/spec_helper.rb.
No such file or directory - /path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/lib/spork/../../assets/bootstrap.rb (Errno::ENOENT)
/path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/lib/spork/test_framework.rb:99:in read' /path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/lib/spork/test_framework.rb:99:in
bootstrap'
/path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/lib/spork/runner.rb:64:in run' /path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/lib/spork/runner.rb:10:in
run'
/path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/gems/spork-1.0.0rc0/bin/spork:10:in <top (required)>' /path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/bin/spork:19:in
load'
/path_to_rvm/.rvm/gems/ruby-1.9.2-p290@gemset_name/bin/spork:19:in `
Sorry, if this is not the fault of your gem but i have no clue. Maybe you can give me a hint if i did install or configure wrongly.
Thanks in advance
Raimund
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Bundler could not find compatible versions for gem "spork":
In Gemfile:
spork-rails (>= 0) ruby depends on
spork (>= 1.0rc0) ruby
guard-spork (>= 0) ruby depends on
spork (0.9.2)
Any thoughts?
Routes are not reloaded at each run.
I need to make it on the app side, for each test suite (rspec, cucumber) :
Spork.each_run do
...
load "#{Rails.root}/config/routes.rb"
...
end
Am currently trying to fix it on my fork, but maybe someone already tried...
Running nested controller specs when spork is not running and not supplying the drb option fails with load_missing_constant error:
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:503:in
load_missing_constant'`
When spork is running and drb option is entered, then it complains of not being able to load jasmine-core:
Exception encountered: #<LoadError: no such file to load -- jasmine-core>
Other specs run fine w(/o) spork.
SO thread also mentions same issue: http://stackoverflow.com/questions/10021288/rails-nested-namespaced-controller-in-rails-3-2-fails-to-load-fine-in-3-0
Another mentions a workaround spork: http://stackoverflow.com/a/11157712
Can you please support the latest Rails 5.
I've been working on a new Rails 4.1.0.beta1
app (started as such, not upgraded from a previous version), using Ruby 2.1.0
, and Spork is giving me some issues.
From my Gemfile.lock
, I'm using spork-rails (4.0.0)
together with guard (2.4.0)
, guard-rspec (4.2.6)
, guard-spork (1.5.1)
and rspec (2.14.1)
.
When I update a model spec and save the changes, it runs correctly (the latest version of said tests is run), but whenever I edit a model and save, Guard detects the change and runs RSpec, but the tests are run against the old version of the code. The code doesn't seem to get reloaded unless I manually restart Spork (which goes against its entire purpose).
In config/environments/test.rb
I have the following two settings:
Rails.application.configure do
config.cache_classes = true
config.eager_load = false
end
These are the default settings that I never changed in any of the other Rails 4.0.0
stable projects, but even when changing them I don't get any significant changes in Spork's behavior.
Here is a practical example of this issue.
I have a simple User
model:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:confirmable, :lockable
validates :username, presence: true, format: { with: /\A[A-Za-z0-9][A-Za-z0-9.\-_]*\z/ }
end
And the following tests in spec/models/users_spec.rb
:
require 'spec_helper'
describe User do
let(:user) { create(:user) }
subject { user }
describe "with an invalid username" do
it "should be invalid" do
invalid_usernames = [
"", "john/doe", "john&doe", "john@doe", "john^doe",
"-john", "_john", ".john", "john doe"
]
invalid_usernames.each do |invalid_username|
user.username = invalid_username
user.should_not be_valid
end
end
end
describe "with a valid username" do
it "should be valid" do
valid_usernames = [
"john_doe", "john.doe", "john-doe", "john-doe123",
"j", "1337doe", "1-2-3"
]
valid_usernames.each do |valid_username|
user.username = valid_username
user.should be_valid
end
end
end
end
These tests pass correctly when run, but as soon as I make any change in the model that would obviously stop the tests from passing, such as validates :username, presence: true, format: { with: /\A\z/ }
, Guard will detect the change, re-run the tests and they'll still be passing, making it seem like the code has not been reloaded by Spork.
This might be a problem caused by a change in Rails 4.1.0.beta1
, because I never encountered this when using other stable versions of Rails.
I'll be trying to downgrade the app I'm working on to see if I can reproduce this issue, also because I need to proceed and this problem is currently making my workflow harder.
I follow the steps , but when running 'cucumber --drb' it prompted the following information:
ARNING: No DRb server is running. Running features locally
The spark server has started.How to solve this problem?
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.