Helper tests using DSL not executing

32 views
Skip to first unread message

Brian McQuay

unread,
May 25, 2013, 12:09:44 PM5/25/13
to minites...@googlegroups.com

Aloha,

I'm having a strange problem getting helper tests to actually execute. My test is in tests/helpers/application_helper_test.rb :

require 'test_helper'

describe ApplicationHelper do
  it 'will fail' do
    assert false
  end
end 

Trivial yet when run: bundle exec rake TEST=test/helpers/application_helper_test.rb

It doesn't seem to even see the tests: 0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

I have an entire test suite already and the helper tests were working a week ago so I'm a bit baffled as to what happened and how to resolve it. Any ideas?

Brian McQuay

unread,
May 25, 2013, 4:38:52 PM5/25/13
to minites...@googlegroups.com
I've narrowed this down to the 'it' line. If I raise an exception anywhere outside of an 'it' line the exception is executed. I can even nest describe and context lines and the exception will run. If I put the exception inside the it block it never executes. This code raises an exception:

describe ApplicationHelper do
  describe '#nav_class' do
    context 'fail' do
      raise 'TEST'
      it "must fail" do
        assert fail
      end
    end 
  end 
end

The following code just returns 0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

describe ApplicationHelper do
  describe '#nav_class' do
    context 'fail' do
      it "must fail" do
        raise 'TEST'
      end
    end 
  end 
end 

Daniel Teixeira

unread,
May 25, 2013, 4:55:55 PM5/25/13
to minites...@googlegroups.com
Which version of minitest are you using? I get a similar error while running with new minitest version (5.0.1)...


--
-- You received this message because you are subscribed to the Google Groups minitest-rails group. To post to this group, send email to minites...@googlegroups.com. To unsubscribe from this group, send email to minitest-rail...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/minitest-rails?hl=en
---
You received this message because you are subscribed to the Google Groups "minitest-rails" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minitest-rail...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Daniel Teixeira
(http://www.google.com/profiles/daniel.t.dt)
Rails Developer

Brian McQuay

unread,
May 25, 2013, 8:18:03 PM5/25/13
to minites...@googlegroups.com
This was on 4.7.4. I just tried upgrading to 5.0.2 but I've got a lot of dependency conflicts. I'm still working through them all so I can't confirm if it still happens on the newer version yet.

Brian McQuay

unread,
May 25, 2013, 10:16:14 PM5/25/13
to minites...@googlegroups.com
I finally resolved all the dependency issues and can confirm this is still happening with version 5.0.2.


You received this message because you are subscribed to a topic in the Google Groups "minitest-rails" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/minitest-rails/VkJ6I5RWsPM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to minitest-rail...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Sincerely,
Brian McQuay
CEO / Developer

Brian McQuay

unread,
May 28, 2013, 12:01:07 AM5/28/13
to minites...@googlegroups.com
Aloha,

I've resolved the issue by backtracking through my git logs and looking at all the Gemfile changes I've made in the past few weeks. I recently added the 'resque_spec' gem which had rspec as a dependency. Removing that gem resolved the problems. Of course it seems obvious in retrospect but minitest and rspec don't play nicely together in the same test.


On Saturday, May 25, 2013 10:09:44 AM UTC-6, Brian McQuay wrote:
Reply all
Reply to author
Forward
0 new messages