spork

Running spork I get the error: Address already in use

有些话、适合烂在心里 提交于 2020-01-02 19:29:13
问题 I'm assuming it was because the process didn't close properly and so is still running. But using top or ps I can't find it. Is there a way to find where it's running, or to have it force reopen the port? 回答1: try sudo netstat -lpn to see what ports are being listened to, and what processes are listening. 回答2: In the case of an old instance of Spork running you may use this command: pkill -f spork 来源: https://stackoverflow.com/questions/6157978/running-spork-i-get-the-error-address-already-in

testing with specs, capybara from railstutorial chapter 3 does not work (have_selector('title', :text => ' | Home'))

三世轮回 提交于 2020-01-01 08:44:45
问题 im working on ruby.railstutorial.org/ruby-on-rails-tutorial-book. Im using rails 3.2.7, spork, rspec, capybara, launchy and some guards :) i have a really weird problem in Chapter 3 with testing: It seems like the tests arent working for what is inside the <head> -Tag. If i put the <title> -tag inside the <body> -tag instead of the head-tag it works fine. Also it works when i put <h1> -tags above the <title> inside <head> -Tags. It is weird, isnt it? Please help me figur out. The example is

Spork and cache_classes problem with rspec, factory_girl and datamapper

邮差的信 提交于 2020-01-01 02:33:07
问题 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) DataMapper::ImmutableError: Immutable resource cannot be modified This is my spec_helper.rb: require 'spork' Spork.prefork do if ENV['CODE_COVERAGE'] == '1' require 'simplecov' SimpleCov.start 'rails' end ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config

Michael Hartl Rails Tutorial (3.2) - Chapter 5 Rspec issue

爱⌒轻易说出口 提交于 2019-12-24 11:32:53
问题 I've completed Chapter 5 and all the exercises. As part of the final exercise, MH has you write tests for the ApplicationHelper method. Once that is done, individual tests pass with: shift-command-T in ST2 (using the sublime-text-2-ruby-tests package) rspec spec/requests/user_pages_spec.rb in the terminal rspec spec/requests/static_pages_spec.rb in the terminal However, if I run all tests with rspec spec/ in the terminal I get this error: /Users/anonymouscoward/rails/railstut/sample_app/spec

Spork is repeatedly re-running failing tests in autotest

人走茶凉 提交于 2019-12-24 05:11:48
问题 I have a new project that I am trying to get up and running with rspec, autotest and spork. I am using: rails 3.0.4 rspec 2.5.0 spork 0.9.0.rc3 autotest 4.4.6 Spork seems to be loading fine (I get a message that it is listening on a port), but when I run autotest with a failing test, it reruns that test over and over. It should just run the test, see that it is failing and stop. Any idea why this behavior is happening? Also, once I make the failing tests pass, autotest stops as it should. If

undefined local variable or method `root_path' (Rspec Spork Guard)

五迷三道 提交于 2019-12-24 00:47:22
问题 I have a newbie question :-) I'm "creating" an app, and I use M. Hartl's Tutorial to do so. But I have some problems since I decided to change my routes.rb. I know the question has already been posted, but the answer doesn't work for me, so I supposed I should ask a new one... Here are the codes : config/routes.rb root to: 'static_pages#home' match '/help', to: 'static_pages#help' match '/contact', to: 'static_pages#contact' match '/about', to: 'static_pages#about' spec/requests/static_pages

Guard Ruby On Rails 3.2 Tutorial

落爺英雄遲暮 提交于 2019-12-23 03:32:12
问题 I'm following along with the Ruby on Rails Tutorial. Things are working pretty well, but I noticed that Guard only runs after I save some files (view or controller files), but doesn't run when I save others (routes or spec files). I've got Guard hooked up to Spork, not sure if that matters. When I looked at the console window running Guard/Spork, I noticed an error after I saved the non-running tests: Exception encountered: #<LoadError: no such file to load -- /Users/Tyler/Development

Rails project using spork - always have to use spork?

笑着哭i 提交于 2019-12-20 09:24:33
问题 If I am using spork in my rails project and have a spec_helper.rb file like this require 'spork' Spork.prefork do ... end Spork.each_run do ... end Does it mean I need to ALWAYS have spork running when I run my specs via rspec spec ? Meaning, if I haven't executed $ spork in a terminal window yet, does it mean my specs will not run properly? 回答1: No. We have spork in our spec helper and we don't use it a lot of the time, since it slows the tests down overall on larger suites. We only run

How do you get cucumber/guard to filter on tags like @wip?

旧巷老猫 提交于 2019-12-19 18:49:26
问题 I'm running spork and guard and all has been going very well with my RSpec tests which were all run correctly. In order to speed up the tests I could successfully filter my RSpec tests with tags I placed in my .rspec file. .rspec --colour --debug --tag focus --tag now Unfortunately though I have not been able to filter my cucumber tags. Every time cucumber runs it runs either everything or just the file that changed. How can I get cucumber/spork/guard to respect tags like @wip, @now etc and

How to combine autotest and spork in Rails testing?

馋奶兔 提交于 2019-12-18 11:30:26
问题 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 : https://github.com/grosser/autotest Spork : http://github.com/timcharper/spork 回答1: ARTICLE1 mikbe has you covered! I would attempt to rephrase it here, but the post does such a great job. If you happen to be on OSX, there are also instructions to utilize