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 156839 - Running Single RSpec file not working with RSpec 1.1.12
Summary: Running Single RSpec file not working with RSpec 1.1.12
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Testing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-14 18:59 UTC by theyaa
Modified: 2009-02-19 23:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Make trunk Netbeans compatitible with edge rspec (as of 02/04/09) (1.37 KB, text/plain)
2009-02-05 05:35 UTC, richpoirier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description theyaa 2009-01-14 18:59:16 UTC
After upgrading to RSpec 1.1.12 gem for rspec and rspec-rails gems, and removing the plugins; Running single RSpec test 
file does not work anymore. It gives the following error.

[Using spec/spec.opts; create spec/spec.opts.netbeans to set options used under the IDE. Suppress this warning message 
by adding -J-Druby.rspec.specopts.warn=false to the flags in etc/netbeans.conf]

	from E:/cms/cms3/vendor/plugins/rspec/lib/spec/runner/options.rb:101:in `run_examples'
Finished in  seconds

0 examples, 0 failures
	from E:/cms/cms3/vendor/plugins/rspec/lib/spec/runner/command_line.rb:9:in `run'
	from E:/cms/cms3/script/spec:5


I tried running the same file from the command line and it worked properly. Please advice.
Comment 1 Erno Mononen 2009-01-14 20:18:03 UTC
Do you have all the latest IDE updates installed? There was a similar RSpec issue that should be fixed in 6.5 patch 1.
Comment 2 theyaa 2009-01-14 20:37:18 UTC
Here is what I have regarding ide version

Product Version: NetBeans IDE 6.5 (Build 200811100001)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\Theyaa\.netbeans\6.5

Thanks
Comment 3 Erno Mononen 2009-01-15 14:05:04 UTC
If you go to Help -> Check for Updates, are there any updates offered?
Comment 4 theyaa 2009-01-15 17:28:57 UTC
No, it tells my my ide is up to date
Comment 5 Erno Mononen 2009-01-15 20:00:26 UTC
OK, thanks for checking it. I'll look into this tomorrow / early next week. Could you please attach the IDE log (http://
wiki.netbeans.org/FaqRubyNBLogging) here? Also, can you try whether running on MRI (i.e. CRuby) instead of JRuby makes 
any difference?
Comment 6 richpoirier 2009-01-15 22:55:54 UTC
I ran into this too and dug into it. ExampleGroup#run now requires options to be passed to it. I fixed it by changing
line 75 of nb_spec_mediator.rb from

success = success & example_group.run

to

success = success & example_group.run(Spec::Runner.options)

Not sure if other places need to be fixed as well, but everything seems to be working for me now.
Comment 7 theyaa 2009-01-15 23:06:14 UTC
Would you point me to the location of nb_spec_mediator.rb file please?
Comment 8 richpoirier 2009-01-15 23:07:29 UTC
/Applications/NetBeans/NetBeans.app/Contents/Resources/NetBeans/ruby2/
Comment 9 Erno Mononen 2009-01-16 14:32:58 UTC
Hi Richard, thanks a lot for finding the cause and for the fix! We need to support older versions too, so I'll add some 
checking for whether the run method requires options as an arg or not.
Comment 10 theyaa 2009-01-16 14:35:25 UTC
Thank you, The method you described worked great, I modified the file and the tests are working again.
Comment 11 Erno Mononen 2009-01-16 17:26:51 UTC
Fixed in d0d0c86837b0. Thanks for reporting and thanks once again to Richard for digging into this!
Comment 12 Quality Engineering 2009-01-17 06:54:09 UTC
Integrated into 'main-golden', will be available in build *200901170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d0d0c86837b0
User: Erno Mononen <emononen@netbeans.org>
Log: #156839: Running Single RSpec file not working with RSpec 1.1.12
Comment 13 theyaa 2009-01-28 19:24:43 UTC
I have updated my ide, netbeans ruby 6.5, today and several updates were available. after updating the same issue 
started to happen that I was not able to run single rspec file. It seems like the fix mentioned in this issue was not 
applied to the updates and got overwritten by the update.

Please make sure the fix goes into any update you send to the ide we use.

Thanks
Comment 14 Erno Mononen 2009-01-28 19:51:17 UTC
Sorry, I guess I wasn't clear - I originally thought that this is fixed by a fix for another issue (that fix was 
delivered in the latest update patch), but I was wrong, it did not fix this issue. This issue is fixed *only* in trunk 
(i.e. dev builds). I'll try to get the fix delivered in the next patch for 6.5. So I'm closing this again, if you can 
reproduce this in 7.0 dev builds (http://bits.netbeans.org/dev/nightly/latest/), then please reopen again. Thanks.
Comment 15 richpoirier 2009-01-28 19:59:15 UTC
FYI, the rspec mediator is broken again in edge rspec so patching it into 6.5 might be fruitless. Maybe you should get
in touch with David Chelimsky and see what you guys can do about backwards compat. I did manage to fix it again but it
wasn't a one liner this time so I can send you a patch file or something if you want. Keep in mind, this is edge rspec
I'm using though so maybe wait till 1.1.13.
Comment 16 Erno Mononen 2009-01-29 07:53:40 UTC
Thanks for the heads up, Richard -- a patch would be very much appreciated! We've actually already exchanged a couple 
of emails with David wrt. RSpec backward compatibility, hopefully we'll have a solution in 7.0 timeframe. Currently the 
problem is that there is no official API for doing what out rspec mediator does, so we have to rely on implementation 
details.
Comment 17 richpoirier 2009-02-05 05:35:34 UTC
Created attachment 76587 [details]
Make trunk Netbeans compatitible with edge rspec (as of 02/04/09)
Comment 18 Erno Mononen 2009-02-05 14:53:39 UTC
Thanks Richard! I'll apply the patch tomorrow. Can you still tell me what is the exact version of rspec where you see 
the problem without the patch? I installed rspec from git head (git://github.com/dchelimsky/rspec.git) and it seems to 
work for me (though I tested just superficially) even without the patch.
Comment 19 richpoirier 2009-02-05 15:52:52 UTC
Really? To double check I just got the Netbeans build from last night and updated my rspec plugin and it definitely
still doesn't work:

/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/example/example_methods.rb:32:in `execute'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:208:in `execute_examples'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:206:in `each'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:206:in `execute_examples'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:99:in `run'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/runner/options.rb:104:in `run_examples'
	/Users/admin/src/agilebuddy/vendor/plugins/rspec/lib/spec/runner/command_line.rb:9:in `run'
	/Users/admin/src/agilebuddy/script/spec:5
	/Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.4/lib/ruby-debug.rb:101:in `debug_load'
	/Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.4/lib/ruby-debug.rb:101:in `debug_program'
	/Library/Ruby/Gems/1.8/gems/ruby-debug-ide-0.4.4/bin/rdebug-ide:82
	/usr/bin/rdebug-ide:19:in `load'
	/usr/bin/rdebug-ide:19
Uncaught exception: undefined method `description' for "":String

Applying my patch fixes it.
Comment 20 Erno Mononen 2009-02-05 16:16:48 UTC
Ah, my bad - I tried just the rspec gem in a plain ruby app. I do get the same error with the plugin in a rails app.
Comment 21 Quality Engineering 2009-02-07 08:38:23 UTC
Integrated into 'main-golden', will be available in build *200902070301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f3b11d17fe90
User: Erno Mononen <emononen@netbeans.org>
Log: #156839: Running Single RSpec file not working with RSpec 1.1.12
- special thanks to richpoirier for the fix