ruby on rails - save_and_open_page and spork, spork is loosing test suite / output -


when run rspec tests spork, every time use capybara's save_and_open_page, spork loosing test suite.. or maybe doesnt output anymore...

see log

# => without save_and_open_page 09:04:24 - info - spork server rspec, test::unit started  09:04:24 - info - guard::rspec running 09:04:24 - info - running specs running tests args ["--drb", "-f", "progress", "-r", "/users/myuser/.rvm/gems/ruby-1.9.3-p392/gems/guard-rspec-2.5.2/lib/guard/rspec/formatter.rb", "-f", "guard::rspec::formatter", "--failure-exit-code", "2", "spec"]... ................  finished in 4.1 seconds 16 examples, 0 failures   randomized seed 50331  done.  # => save_and_open_page, no .... shown anymore 09:04:29 - info - guard watching @ '/users/myuser/coding/myproject' 09:04:39 - info - running: spec/features/registration/registration_process_spec.rb running tests args ["--drb", "-f", "progress", "-r", "/users/myuser/.rvm/gems/ruby-1.9.3-p392/gems/guard-rspec-2.5.2/lib/guard/rspec/formatter.rb", "-f", "guard::rspec::formatter", "--failure-exit-code", "2", "spec/features/registration/registration_process_spec.rb"]... done.  # => without save_and_open_page, no .... anymore (after restart works again) [1] guard(main)> running tests args ["--drb", "-f", "progress", "-r", "/users/myuser/.rvm/gems/ruby-1.9.3-p392/gems/guard-rspec-2.5.2/lib/guard/rspec/formatter.rb", "-f", "guard::rspec::formatter", "--failure-exit-code", "2", "spec/features/registration/registration_process_spec.rb"]... done.      # => here added errors code... still no error message shown... [1] guard(main)> running tests args ["--drb", "-f", "progress", "-r", "/users/myuser/.rvm/gems/ruby-1.9.3-p392/gems/guard-rspec-2.5.2/lib/guard/rspec/formatter.rb", "-f", "guard::rspec::formatter", "--failure-exit-code", "2", "spec/features/registration/registration_process_spec.rb"]... done.  # works again after restarting spork 

any suggestions?

somehow stdout getting replaced other buffer. whatever being written capybara stdout getting ignored or consumed somewhere else.

try following:

# add global before/after blocks before :each   @old_stdout, @old_stderr = stdout, stderr end  after :each   stdout,  stderr  = @old_stdout, @old_stderr    # gems use $stdout , $stderr, instead of stdout , stderr, replace   $stdout, $stderr = @old_stdout, @old_stderr end 

capybara's save_and_open_page uses launchy gem. believe stdout , stderr getting stubbed in 1 of these gems.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -