Forum: Ruby Rspec + Oracle

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B60e912e4197b989217622463d622da9?d=identicon&s=25 (Guest)
on 2007-05-15 12:25
(Received via mailing list)
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 =" in my spec I get
"ArgumentError in 'Country should be valid'
block not supplied
12:in `describe'"

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

I have found some modifications for Rspec 0.9.2 in files
but those modifications have not helped me.

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

  it "should be valid" do
    @countries.should be_valid
Does anybody know how I can use method "new" of model in my Rspec's
files with Oracle?
B60e912e4197b989217622463d622da9?d=identicon&s=25 (Guest)
on 2007-05-18 13:51
(Received via mailing list)
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
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 :).
This topic is locked and can not be replied to.