What happens if you
Page.stub_chain(:criteria, :id).and_return([mock_model("Page", :title =>
"foobar")])
(i.e., replace the mocked MongoidCriteria with a single-element Array
containing the mocked Page)
On Fri, Mar 25, 2011 at 8:18 AM, amkirwan wrote:
> no unfortunately that does not work eith
finally, I solved this code.
require 'rspec'
class Ary
attr_reader :ary
def initialize
@count = 0
@ary = []
increment
end
def increment
@ary << @count
@count += 1
end
end
describe Ary, "#ary" do
subject{ Ary.new }
it "should increment the ary" do
# expect { subject.in
no unfortunately that does not work either. I receive the error: undefined
method `title' for #___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users