[rspec-users] before(:all) leaves records in database

2011-11-25 Thread Zhi-Qiang Lei
Hi, When I test my Rails controller, I find that records created in before(:all) remain in database while records created in before(:each) and let are wiped out after testing. This made me run "rake test:prepare" for every new test. Is that normal? Best regards, Zhi-Qiang Le

[rspec-users] How to run example group in transaction

2011-03-04 Thread Zhi-Qiang Lei
::Error::Rollback) } end end core_application_spec.rb:9:in `block in run': super: no superclass method `run' for RSpec::Core::ExampleGroup::Nested_1:Class (NoMethodError) Best regards, Zhi-Qiang Lei zhiqiang@gmail.com ___ rspec-users ma

Re: [rspec-users] Mock in lambda?

2010-12-25 Thread Zhi-Qiang Lei
nks. On Dec 26, 2010, at 1:25 PM, David Chelimsky wrote: > On Sun, Dec 26, 2010 at 12:05 AM, Zhi-Qiang Lei > wrote: >> Hi, >> >> I have a lambda. >> >> Test = lambda { kill(333) } >> >> How should I spec if I want to make sure this Test will send

Re: [rspec-users] Mock in lambda?

2010-12-25 Thread Zhi-Qiang Lei
Sorry, it is my codes' fault. It works now. On Dec 26, 2010, at 3:47 PM, Zhi-Qiang Lei wrote: > Hi, > > I'm trying to mock the scope. > > Test = lambda { kill(333) } > app = double("test") > app.should_receive(:kill).with(333).once > app.instance

[rspec-users] Mock in lambda?

2010-12-25 Thread Zhi-Qiang Lei
Hi, I have a lambda. Test = lambda { kill(333) } How should I spec if I want to make sure this Test will send kill message with 333? Thanks. Best regards, Zhi-Qiang Lei zhiqiang@gmail.com ___ rspec-users mailing list rspec-users@rubyforge.org

[rspec-users] stub! does not work

2010-12-03 Thread Zhi-Qiang Lei
nt.should_receive(:all).and_return({}) uninitialized constant RSpec::Core::ExampleGroup::Nested_1::Nested_2::Nested_1::LoadEvent # ./spec/core_application_spec.rb:42:in `block (4 levels) in ' Best regards, Zhi-Qiang Lei zhiqiang@gmail.com _

Re: [rspec-users] Strange return value

2010-10-01 Thread Zhi-Qiang Lei
On Oct 1, 2010, at 8:48 PM, David Chelimsky wrote: > On Oct 1, 2010, at 6:11 AM, Zhi-Qiang Lei wrote: > >> Dear All, >> >> I meet a strange issue when I test my Rack Middleware. Could anyone help me >> to point the error out? Thanks. >> >> This i

[rspec-users] Strange return value

2010-10-01 Thread Zhi-Qiang Lei
Dear All, I meet a strange issue when I test my Rack Middleware. Could anyone help me to point the error out? Thanks. This is the code. class EIOUAuthorization def initialize(app) @app = app end def call(env) request = Rack::Request.new(env) path_strings = request.path_info.sp

Re: [rspec-users] Monitor method invoking from superclass

2010-09-30 Thread Zhi-Qiang Lei
On Sep 30, 2010, at 9:56 PM, Rick DeNatale wrote: > On Thu, Sep 30, 2010 at 9:45 AM, David Chelimsky wrote: >> On Sep 30, 2010, at 8:20 AM, Zhi-Qiang Lei wrote: > >>>>> I want to if B is receive 'super' message. Thanks. >>>> >>>>

Re: [rspec-users] Monitor method invoking from superclass

2010-09-30 Thread Zhi-Qiang Lei
On Sep 30, 2010, at 9:15 PM, David Chelimsky wrote: > On Sep 30, 2010, at 7:45 AM, Zhi-Qiang Lei wrote: > >> On Sep 30, 2010, at 7:59 PM, David Chelimsky wrote: >> >>> On Sep 30, 2010, at 4:02 AM, Zhi-Qiang Lei wrote: >>> >>>> Dear All, &g

Re: [rspec-users] Monitor method invoking from superclass

2010-09-30 Thread Zhi-Qiang Lei
Class A def a #some code end end Class B def a #some code super end end I want to if B is receive 'super' message. Thanks. On Sep 30, 2010, at 7:59 PM, David Chelimsky wrote: > On Sep 30, 2010, at 4:02 AM, Zhi-Qiang Lei wrote: > >> Dear All, >>

[rspec-users] Monitor method invoking from superclass

2010-09-30 Thread Zhi-Qiang Lei
Dear All, Class B is a subclass of class A. Could anyone tell me how to monitor if object created from class B receives a super message when its method is invoked. Thanks. Best regards, Lei, Zhi-Qiang ___ rspec-users mailing list rspec-users@rubyforge