Search code examples
ruby-on-railsrspecguard

Specs in Rails don't start


I have rspec with some specs but after some migrations the specs don't start. I execute

bundle exec rake spec

And the command with the correct Ruby version and some specs I have are shown:

/Users/jose/.rvm/rubies/ruby-1.9.3-p327/bin/ruby -S rspec ./spec/controllers/apps_controller_spec.rb ./spec/integration/users_spec.rb

But after that, nothing is shown. I've tried with Guard too, but I get the same result.

I've rollback to previous migrations but nothing happens.

Any solutions or workarounds?

P.S. This is my gemfile -> https://gist.github.com/4258413


Solution

  • Ok, problem solved.

    I was including all the files under lib in spec_helper.rb:

    Dir[Rails.root.join("lib/**/*.rb")].each {|f| require f}
    

    The problem was that in that directory I had a daemon too, so something like this was executed every time.

    $running = true
    Signal.trap("TERM") do 
      $running = false
    end
    
    while($running) do
      # do things
      sleep 10
    end 
    

    Sorry for a silly question.