Rails 4.2.2-Windows 7 / No test results displayed on git Bash for: bundle exec guard
Everything is fine except
when I run
$ bundle exec guard
I CAN'T SEE THE TEST RESULTS as I did when running:
$ bundle exec rake test
This happens every time I edit the file.
02:28:43 - INFO - Run 'gem install win32console' to use color on Windows
02:28:44 - INFO - Guard::Minitest 2.3.1 is running, with Minitest::Unit 5.7.0!
02:28:44 - INFO - Running: all tests
β]2;[Minitest results] Running: all tests
[1] guard(main)> Guard is now watching at 'c:/row/dev1/sample_app'
02:29:08 - INFO - Running: test/controllers/static_pages_controller_test.rb
[1] guard(main)> ults] Running: test/controllers/static_pages_controller_test.rb
But I cannot see the test results, how can I when I run
$ bundle exec rake test
the output will be
ansi: 'gem install win32console' to use color on Windows
Started
FAIL["test_should_get_home", StaticPagesControllerTest, 2015-07-12 12:20:51 -0700]
test_should_get_home#StaticPagesControllerTest (1436728851.31s)
<Home | Ruby on Rails Tutorial Sample App> expected but was
<| Ruby on Rails Tutorial Sample App>..
Expected 0 to be >= 1.
test/controllers/static_pages_controller_test.rb:7:in `block in <class:StaticPagesControllerTest>
3/3: [===================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.37550s
3 tests, 6 assertions, 1 failures, 0 errors, 0 skips
02:54:47 - INFO - Run 'gem install win32console' to use color on Windows
β]2;[Minitest results] 3 tests
I can't see that I have an error even though the tests seem to be running ... or am I missing something?
This is my Guardfile
# Defines the matching rules for Guard.
guard :minitest, spring: true, all_on_start: true do
watch(%r{^test/(.*)/?(.*)_test\.rb$})
watch('test/test_helper.rb') { 'test' }
watch('config/routes.rb') { integration_tests }
watch(%r{^app/models/(.*?)\.rb$}) do |matches|
"test/models/#{matches[1]}_test.rb"
end
watch(%r{^app/controllers/(.*?)_controller\.rb$}) do |matches|
resource_tests(matches[1])
end
watch(%r{^app/views/([^/]*?)/.*\.html\.erb$}) do |matches|
["test/controllers/#{matches[1]}_controller_test.rb"] +
integration_tests(matches[1])
end
watch(%r{^app/helpers/(.*?)_helper\.rb$}) do |matches|
integration_tests(matches[1])
end
watch('app/views/layouts/application.html.erb') do
'test/integration/site_layout_test.rb'
end
watch('app/helpers/sessions_helper.rb') do
integration_tests << 'test/helpers/sessions_helper_test.rb'
end
watch('app/controllers/sessions_controller.rb') do
['test/controllers/sessions_controller_test.rb',
'test/integration/users_login_test.rb']
end
watch('app/controllers/account_activations_controller.rb') do
'test/integration/users_signup_test.rb'
end
watch(%r{app/views/users/*}) do
resource_tests('users') +
['test/integration/microposts_interface_test.rb']
end
end
# Returns the integration tests corresponding to the given resource.
def integration_tests(resource = :all)
if resource == :all
Dir["test/integration/*"]
else
Dir["test/integration/#{resource}_*.rb"]
end
end
# Returns the controller tests corresponding to the given resource.
def controller_test(resource)
"test/controllers/#{resource}_controller_test.rb"
end
# Returns all tests for the given resource.
def resource_tests(resource)
integration_tests(resource) << controller_test(resource)
end
And this is my gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.2'
# Use SCSS for stylesheets
gem 'sass-rails', '5.0.2'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.5.3'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '4.1.0'
# Use jquery as the JavaScript library
gem 'jquery-rails', '4.0.3'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '2.2.3'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'turbolinks', '2.3.0'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', '3.4.0'
gem 'sqlite3', '1.3.10'
gem 'web-console', '2.2.1'
gem 'spring', '1.1.3'
gem 'tzinfo-data'
end
# adding group for postgresql production
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
end
At the root of my application, I ran:
bundle exec guard init
then i go to
bundle exec guard
ANY IDEAS ANY? do i need another stone? Or am I missing something? Thnx!
source to share
At first I thought you were missing wdm, however it is not. After installing the wdm gem, my output went from identical to yours:
$ bundle exec guard
20:02:44 - INFO - Run "gem install win32console" to use the color on Windows
20:02:46 - INFO - Guard :: Minitest 2.3.1 is running, Minitest :: Unit 5.8.3!
[1] guard (main)> Guard now looks at 'c: / Users / GeoffRuby / Desktop / sample_app'
20:02:59 - INFO - Run: test / controllers / static_pages_controller_test.rb
[1] guard (main)>
You can see that the erroneous output from the command line is protected. I am going to discuss with the creator of wdm and hopefully we can get answers.
source to share