Coder Social home page Coder Social logo

spork-rails's People

Contributors

andyw8 avatar kurko avatar sahilm avatar simi avatar timcharper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

spork-rails's Issues

Helpers aren't loaded

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 is ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]
  • Rails is 3.0.12

Everything is fine when:

  • I run with spork 1.0.0rc2 only (removing spork-rails from the Gemfile). This is not acceptable since spork does not reload the controllers anymore.
  • I run without spork at all.

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...

running spork after gem install spork rails

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

'
from /Users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14: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.

Deprecation with RSpec 2.99.0 rc1

<RSpec::Core::DeprecationError: Instantiating a 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:11

RuntimeError

0`

Please help,I'm stuck on here for 3 days,I can't find a way to solve.

Doesn't seem to work with RSpec 3.0

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?

bootstrap problem with spork

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

  • guard-rspec (installs 0.6.0 + guard 1.0.0 as dependency),
  • spork-rails (installs 3.2.0 + spork 1.0.0rc0 as dependency) and
  • rspec-rails (installs rspec-rails 2.8.1 + rspec 2.8 as dependency)

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:inbootstrap'
/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:inrun'
/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:inload'
/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

Gem won't install. Says requires spork > 1.0rc0!?

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

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...

spork fails to load nested namespaced controller specs in Rails 3.2.16

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

Spork not reloading code properly in Rails 4.1.0.beta1

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.