Re: [rspec-users] stubbing gets undone?

2011-02-15 Thread Scott Taylor
Is #unstub being called at any point? Scott On Feb 16, 2011, at 12:54 AM, Fearless Fool wrote: > I'm looking at an example where a stub seems to work sometimes, and > sometimes appears to become "unstubbed". I haven't boiled it down to a > minimal example, but it goes something like this: > --

Re: [rspec-users] stubbing gets undone?

2011-02-15 Thread Fearless Fool
Hmm - when I print puts(premise) rather than puts(premise.inspect), I can see that they actually have different addresses, so they're not really equal: just stubbed # entering lookup_stuff_on_the_web with # Now my problem is figuring out why/where the other Premise is getting created. In

[rspec-users] stubbing gets undone?

2011-02-15 Thread Fearless Fool
I'm looking at an example where a stub seems to work sometimes, and sometimes appears to become "unstubbed". I haven't boiled it down to a minimal example, but it goes something like this: the model: class Premise << ActiveRecord::Base def lookup_stuff_on_the_web $stderr.puts("entering

[rspec-users] RSpec Error - "Invalid Option"

2011-02-15 Thread Trenton Scott
I keep getting an issue when running RSpec with Autotest. My ~/.autotest file looks like this: ==FILE BEGINS== require 'autotest/growl' require 'autotest/fsevent' Autotest.add_hook :initialize do |autotest| autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do autotest.files_matc

Re: [rspec-users] Stubbing Scopes

2011-02-15 Thread Justin Ko
On Feb 15, 11:14 am, Christoph Schiessl wrote: > Thanks for your suggestion Justin, but I don't believe that the problem is > time zone related. Time objects usually don't "loose" their Time Zone when > performing operations on them. Here's an example for illustration: > > $ rails console > Lo

Re: [rspec-users] Stubbing Scopes

2011-02-15 Thread Christoph Schiessl
Thanks for your suggestion Justin, but I don't believe that the problem is time zone related. Time objects usually don't "loose" their Time Zone when performing operations on them. Here's an example for illustration: $ rails console Loading development environment (Rails 3.0.4) ruby-1.8.7-p330 :

Re: [rspec-users] Stubbing Scopes

2011-02-15 Thread Justin Ko
Your expectation (should_receive) is expecting "start_of_day", which uses Time.zone. The actual "on_day" scope does "day.to_time.beginning_of_day", which does not use any time zone. Therefore, the arguments to in_interval are not the same as the expectation. And because they are not the same, the m

[rspec-users] Stubbing Scopes

2011-02-15 Thread Christoph Schiessl
Hi! I'm trying to test the following (simplified) model: class Allocation < ActiveRecord::Base scope :in_interval, (proc do |start_of_interval, end_of_interval| params = {:s => start_of_interval, :e => end_of_interval} where("(starts_at > :s AND starts_at < :e) OR (ends_at > :s AND ends

[rspec-users] tcmalloc error running rspec spec using ree

2011-02-15 Thread JDeville
I'm using ree via rvm. Everything was just installed. In autotest, the tests won't even start to run. When I run rspec spec, the tests will run, but will crash at some point here: src/tcmalloc.cc:390] Attempt to free invalid pointer: 0x10022d9a0 I'm not really sure where to look. Any recommend

Re: [rspec-users] Not loading RSpec::Rails::MailerExampleGroup

2011-02-15 Thread Andrei Maxim
On 2011-02-15 14:56:52 +0200, David Chelimsky said: On Feb 15, 2011, at 9:11 AM, Andrei Maxim wrote: I could not find a way to tell RSpec to not load the ActionMailer-related modules and classes. Is there a setting in the configuration that will do that? Or is this a bug? This was fixed in

Re: [rspec-users] Not loading RSpec::Rails::MailerExampleGroup

2011-02-15 Thread David Chelimsky
On Feb 15, 2011, at 9:11 AM, Andrei Maxim wrote: > Hi all, > > I'm working on Rails 3 application with ActiveRecord and ActionMailer > stripped out (I've commented out the respective lines in > config/application.rb), but I'm running into some problems when I'm running > the specs either via t

[rspec-users] Not loading RSpec::Rails::MailerExampleGroup

2011-02-15 Thread Andrei Maxim
Hi all, I'm working on Rails 3 application with ActiveRecord and ActionMailer stripped out (I've commented out the respective lines in config/application.rb), but I'm running into some problems when I'm running the specs either via the `rake spec` command or by running `autotest`. I could n