Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Noob: run/rspec mismatch?
icon9.gif  Noob: run/rspec mismatch? [message #646906] Mon, 03 January 2011 02:17 Go to next message
Michael Hill is currently offline Michael HillFriend
Messages: 1
Registered: January 2011
Junior Member
I am trying to run from helios sr1, under win64, with the dev dltk. (I had the same issues with the stable one.)

Run from the command line works fine:
ruby C:/Ruby192/bin/rspec cash_register_solo_code_and_coffee.rb
.......
9 succeses blah blah blah.

---------------
Run from inside eclipse issues errors. if the .rb file is selected and I run as ruby test, i get:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- spec (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/eclipse/configuration/org.eclipse.osgi/bundles/340/1/.cp/ testing/dltk-rspec-runner.rb:12:in `rescue in <main>'
from C:/eclipse/configuration/org.eclipse.osgi/bundles/340/1/.cp/ testing/dltk-rspec-runner.rb:3:in `<main>'

________
If I select the rb file and run as ruby script, i get:
C:/Users/Mike/workspace/CashRegisterRuby/cash_register_solo_ code_and_coffee.rb:56:in `<class:Test_cash_register>': undefined method `describe' for Test_cash_register:Class (NoMethodError)
from C:/Users/Mike/workspace/CashRegisterRuby/cash_register_solo_ code_and_coffee.rb:49:in `<main>'

I have no doubt this is because of some trivial config, setup, or buildpath error. But I've googled and googled, and I clearly don't have the right search string for it.

Thanks so much for your help!
Mike Hill

Re: Noob: run/rspec mismatch? [message #846682 is a reply to message #646906] Mon, 16 April 2012 17:09 Go to previous message
M Flores is currently offline M FloresFriend
Messages: 1
Registered: April 2012
Junior Member
I got a similar error: undefined method `describe' for main:Object (NoMethodError).

I am using rspec.

The solution for that has to do with two procedures:
1. I had to copy the rspec folders from the C:\Ruby193\lib\ruby\gems\1.9.1\gems folder to my project folder and
2. include the following snippet at the beginning of the script:
require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'rspec-core', version
load Gem.bin_path('rspec-core', 'rspec', version)

require 'rspec'

I hope this helps.
PS: I am using rspec 2.9.0
-M
Previous Topic:TCL Remote Debugging Issue - Not able to step-into a proc
Next Topic:Tcl wrong error marking
Goto Forum:
  


Current Time: Mon Oct 07 23:39:58 GMT 2024

Powered by FUDForum. Page generated in 0.05574 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top