This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 151652

Summary: Shoulda testing support
Product: ruby Reporter: nigel_bris <nigel_bris>
Component: TestingAssignee: Erno Mononen <emononen>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description nigel_bris 2008-10-29 00:09:27 UTC
Shoulda (http://www.thoughtbot.com/projects/shoulda) is a new testing plugin for rails. It reduces the amount of test code considerably and has become 
quite popular.

Currently the entire test file feature works within NetBeans, the single test does not (it cant pickup the the methods start with shoulda)
Comment 1 Erno Mononen 2008-10-29 09:45:25 UTC
Targetting 7.0, though I have to look into this in more details. But if shoulda supports running a single test the same 
way as Test/Unit does, then implementing this should be just a question of finding the current method. In addition Go 
to Source (for passed methods) / run again / debug actions don't work for Shoulda yet.

BTW, in daily builds there is slightly improved support for Shoulda, see issue 150613 (just in case you didn't notice 
the issue).
Comment 2 Erno Mononen 2009-01-15 09:07:34 UTC
Should be done now, run focused test in the editor and run again / debug actions in the test results view should work 
now. Changesets 11d70f94aecd and 6039341cf9b3. Let us know if you find any problems.
Comment 3 Quality Engineering 2009-01-16 07:25:07 UTC
Integrated into 'main-golden', will be available in build *200901160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6039341cf9b3
User: Erno Mononen <emononen@netbeans.org>
Log: #151652: Shoulda testing support
- made the run again / debug actions in the test result tree work with shoulda tests
Comment 4 nigel_bris 2009-01-18 11:15:48 UTC
Tested and works great....
Comment 5 nigel_bris 2009-01-23 07:20:42 UTC
Found 2 issues after using for the last week

1. Test will only run if they have a context so below does not run
class UserTest < ActiveSupport::TestCase
  should "be true" do
    assert true
  end
end
----------------------
2. Spaces at end of test OR context name stops test from running
  context "good " do
    should "be true " do
      assert true
    end
  end


Comment 6 Erno Mononen 2009-01-23 11:59:50 UTC
Thanks for catching these, I'm working on a fix.
Comment 7 Erno Mononen 2009-01-23 14:44:15 UTC
Those issues should be fixed now in #2408120e6511 (there'll be a notification here when the fixes get integrated), 
please give it a try and let us know again whether you still face problems.
Comment 8 Quality Engineering 2009-01-24 18:53:24 UTC
Integrated into 'main-golden', will be available in build *200901241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/2408120e6511
User: Erno Mononen <emononen@netbeans.org>
Log: #151652: Shoulda testing support
- fixed two issues with running focused test:
	- 'should' without 'context'
	- spaces in names
Comment 9 nigel_bris 2009-01-25 02:34:45 UTC
Tested both little tweaks and they work great...  Thanks for such fast response....