Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Rspec + Oracle

Reply
Thread Tools

Rspec + Oracle

 
 
shatorkin@gmail.com
Guest
Posts: n/a
 
      05-15-2007
Hi all.
Does anybody use Rspec with Oracle? I have RoR app + Oracle DB. I use
Rspec 0.9.4.
I have installed Rspec plugin and generated spec for model Country.
If I use "@countries = Country.new" in my spec I get
"ArgumentError in 'Country should be valid'
block not supplied
/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/kernel.rb:
12:in `describe'"

"@countries = Country.find(:first)" works but "@countries =
Country.new" doesn't work.

I have found some modifications for Rspec 0.9.2 in files
"/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/kernel.rb"
and
"usr/lib/ruby/gems/1.8/gems/rspec-0.9.4/lib/spec/runner/extensions/
kernel.rb"
but those modifications have not helped me.

This is my spec:
"
require File.dirname(__FILE__) + '/../spec_helper'
describe Country do
before(:each) do
@countries = Country.new
# @countries = Country.find(:first)
end

it "should be valid" do
@countries.should be_valid
end
end
"
Does anybody know how I can use method "new" of model in my Rspec's
files with Oracle?
Thanks.

 
Reply With Quote
 
 
 
 
shatorkin@gmail.com
Guest
Posts: n/a
 
      05-18-2007
I make work rspec with oracle.
I have a spec what contains Model.find(1) cause (record with id=1
exists in the table).
Model.find(:first) works well

Spec uses method "instance_eval" where name of ruby file and row
number are passed as parameter.
When script invokes "describe" method of OCI8 Class
(oracle_adapter.rb) it is failed with error message "block not
supplied".
When I added an alias: "alias_method :my_describe,:describe" and
called 'my_describe' instead of 'describe' spec did work well.
Whose is this bug - ruby,spec, or oracle_adapter I have not known
yet .

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rspec-1.3.1 and rspec-rails-1.3.3 are released! David Chelimsky Ruby 0 10-10-2010 02:51 AM
rspec-1.3.1.rc and rspec-rails-1.3.3.rc are released! David Chelimsky Ruby 0 10-03-2010 10:42 PM
[ANN] rspec and rspec-rails 1.2.9.rc1 Released David Chelimsky Ruby 0 09-15-2009 12:53 AM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
Oracle adapter don't work with Oracle 10.1.0.2 v. Client vaidas gudas ASP .Net 1 10-11-2004 01:11 PM



Advertisments