Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests not found when using test_folders #144

Open
NicolasWebDev opened this issue Jan 3, 2017 · 0 comments
Open

Tests not found when using test_folders #144

NicolasWebDev opened this issue Jan 3, 2017 · 0 comments

Comments

@NicolasWebDev
Copy link

Hi,

I am using guard-minitest to test a ruby script.
The versions are:

guard (2.14.0)
guard-minitest (2.4.6)

I have the following directory structure:

.
├── generate_certificates.rb
├── Guardfile
└── test_generate_certificates.rb

I don't want to use a test or spec directory so the content of my Guardfile is:

guard :minitest, test_folders: '.' do
  watch(%r{^test_(.*)\.rb$})        { |m| "./test_#{m[1]}.rb" }
  watch(%r{^(.*)\.rb$})             { |m| "./test_#{m[1]}.rb" }
end

Like that, everything works fine.

Expected string default value for '--listen-on'; got false (boolean)                                                                                                                                      [15/9225]
19:21:43 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
19:21:43 - DEBUG - Notiffany: growl not available (Unsupported platform "linux-gnu").
19:21:43 - DEBUG - Notiffany: terminal_notifier not available (Unsupported platform "linux-gnu").
19:21:43 - DEBUG - Notiffany: libnotify not available (Please add "gem 'libnotify'" to your Gemfile and run your app with "bundle exec".).
19:21:43 - DEBUG - Command execution: which notify-send
19:21:43 - DEBUG - Command execution: {"ALTERNATE_EDITOR"=>"false"} emacsclient --eval '1'
19:21:43 - DEBUG - Notiffany: emacs not available (Emacs client failed).
19:21:43 - DEBUG - Command execution: tmux -V
19:21:43 - DEBUG - Notiffany: file not available (No :path option given).
19:21:43 - DEBUG - Command execution: which notify-send
19:21:43 - DEBUG - Command execution: tmux -V
19:21:43 - DEBUG - Notiffany is using NotifySend to send notifications.
19:21:43 - DEBUG - Notiffany is using Tmux to send notifications.
19:21:43 - DEBUG - Command execution: tmux list-clients -F '#{client_tty}'
19:21:43 - DEBUG - Command execution: tmux show -t /dev/pts/5
19:21:43 - DEBUG - Command execution: tmux show -t /dev/pts/3
19:21:43 - DEBUG - Command execution: tmux show -t /dev/pts/0
19:21:43 - DEBUG - Command execution: tmux show -t /dev/pts/22
19:21:43 - DEBUG - Notiffany is using TerminalTitle to send notifications.
WARN: Unresolved specs during Gem::Specification.reset:
      minitest (>= 3.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
19:21:44 - DEBUG - Command execution: hash stty
19:21:44 - DEBUG - Guard starts all plugins
19:21:44 - DEBUG - Hook :start_begin executed for Guard::Minitest
19:21:44 - INFO - Guard::Minitest 2.4.6 is running, with Minitest::Unit 5.10.1!
19:21:44 - INFO - Running: all tests
19:21:44 - DEBUG - Running: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
19:21:44 - DEBUG - Command execution: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
basename: unrecognized option '--guard'
Try 'basename --help' for more information.
Run options: --guard --seed 21593

# Running:

..

Finished in 0.000959s, 2085.0753 runs/s, 1042.5376 assertions/s.

2 runs, 1 assertions, 0 failures, 0 errors, 0 skips

19:21:44 - DEBUG - Hook :start_end executed for Guard::Minitest
19:21:44 - INFO - Guard is now watching at '/home/sathors/windows_share/test/tmp'
19:21:44 - DEBUG - Start interactor
19:21:48 - DEBUG - Interactor was stopped or killed
19:21:48 - DEBUG - Hook :run_on_modifications_begin executed for Guard::Minitest
19:21:48 - INFO - Running: all tests
19:21:48 - DEBUG - Running: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
19:21:48 - DEBUG - Command execution: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
basename: unrecognized option '--guard'
Try 'basename --help' for more information.
Run options: --guard --seed 28039

# Running:

..

Finished in 0.000920s, 2172.8810 runs/s, 1086.4405 assertions/s.

2 runs, 1 assertions, 0 failures, 0 errors, 0 skips

19:21:48 - DEBUG - Hook :run_on_modifications_end executed for Guard::Minitest
19:21:48 - DEBUG - Start interactor
+[1] guard(main)> 

But if in the block I don't set the leading ".", as in

guard :minitest, test_folders: '.' do
  watch(%r{^test_(.*)\.rb$})        { |m| "test_#{m[1]}.rb" }
  watch(%r{^(.*)\.rb$})             { |m| "test_#{m[1]}.rb" }
end

then the tests are not run anymore (because they are not found).

Knowing that the test_folders is the current directory, I would expect the path returned by the block to be searched within the current directory.

Here are the logs:

Expected string default value for '--listen-on'; got false (boolean)
19:24:53 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run your app with "bundle exec".).
19:24:53 - DEBUG - Notiffany: growl not available (Unsupported platform "linux-gnu").
19:24:53 - DEBUG - Notiffany: terminal_notifier not available (Unsupported platform "linux-gnu").
19:24:53 - DEBUG - Notiffany: libnotify not available (Please add "gem 'libnotify'" to your Gemfile and run your app with "bundle exec".).
19:24:53 - DEBUG - Command execution: which notify-send
19:24:53 - DEBUG - Command execution: {"ALTERNATE_EDITOR"=>"false"} emacsclient --eval '1'
19:24:53 - DEBUG - Notiffany: emacs not available (Emacs client failed).
19:24:53 - DEBUG - Command execution: tmux -V
19:24:53 - DEBUG - Notiffany: file not available (No :path option given).
19:24:53 - DEBUG - Command execution: which notify-send
19:24:53 - DEBUG - Command execution: tmux -V
19:24:53 - DEBUG - Notiffany is using NotifySend to send notifications.
19:24:53 - DEBUG - Notiffany is using Tmux to send notifications.
19:24:53 - DEBUG - Command execution: tmux list-clients -F '#{client_tty}'
19:24:53 - DEBUG - Command execution: tmux show -t /dev/pts/5
19:24:53 - DEBUG - Command execution: tmux show -t /dev/pts/3
19:24:53 - DEBUG - Command execution: tmux show -t /dev/pts/0
19:24:53 - DEBUG - Command execution: tmux show -t /dev/pts/22
19:24:53 - DEBUG - Notiffany is using TerminalTitle to send notifications.
WARN: Unresolved specs during Gem::Specification.reset:
      minitest (>= 3.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
19:24:54 - DEBUG - Command execution: hash stty
19:24:54 - DEBUG - Guard starts all plugins
19:24:54 - DEBUG - Hook :start_begin executed for Guard::Minitest
19:24:54 - INFO - Guard::Minitest 2.4.6 is running, with Minitest::Unit 5.10.1!
19:24:54 - INFO - Running: all tests
19:24:54 - DEBUG - Running: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
19:24:54 - DEBUG - Command execution: ruby -I"." -r minitest/autorun -r ././test_generate_certificates.rb -e "" -- --guard
basename: unrecognized option '--guard'
Try 'basename --help' for more information.
Run options: --guard --seed 28631

# Running:

..

Finished in 0.001208s, 1655.8074 runs/s, 827.9037 assertions/s.

2 runs, 1 assertions, 0 failures, 0 errors, 0 skips

19:24:54 - DEBUG - Hook :start_end executed for Guard::Minitest
19:24:54 - INFO - Guard is now watching at '/home/sathors/windows_share/test/tmp'
19:24:54 - DEBUG - Start interactor
19:25:07 - DEBUG - Interactor was stopped or killed
19:25:07 - DEBUG - Hook :run_on_modifications_begin executed for Guard::Minitest
19:25:07 - DEBUG - Start interactor
+[1] guard(main)> 

I have spent one hour resolving my problem.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant