[rspec-users] Rspec: gem vs. plugin?

2008-10-08 Thread Wes Gamble
All, I have some experience with Rspec from about a year ago. At that time, there was a gem and a plugin, and a Rspec on Rails plugin. Should I only be using the gem? With the 1.1.8 gem, if I try to do "rake rspec" in my Rails app., nothing happens. Do I need to use the Rspec Rails plugin

Re: [rspec-users] Rspec: gem vs. plugin?

2008-10-08 Thread Wes Gamble
Spec-Rails gem is? Is there a place online that summarizes the various distribution methods and when to use which? Thanks, Wes Scott Taylor wrote: On Oct 8, 2008, at 2:09 PM, Wes Gamble wrote: All, I have some experience with Rspec from about a year ago. At that time, there was a gem an

Re: [rspec-users] Rspec: gem vs. plugin?

2008-10-08 Thread Wes Gamble
ct 8, 2008 at 2:39 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: I know that this is all probably rather boring for the expert RSpec-ers out there, and I apologize for that. Both Rspec and Rspec-Rails are currently distributed as both plugins AND gems? Are the plugins just available in ca

[rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
With Rails, is "rake spec" supposed to automatically run under the test environment? I have to do "rake spec RAILS_ENV=test" in order to get the environments/test.rb file to load. Also, are the standard Test::Unit fixtures automatically loaded before each test in each spec file? This appears

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
Zach, Zach Dennis wrote: # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'spec' require 'spec/rails' This is exactly what

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
Correction to above: Wes Gamble wrote: > 2) If I run "spec spec/*spec.rb", then all _but one_ run without error > (note that the one that fails can be run successfully using a direct > call to it as in #1 above). -- Posted via http:/

[rspec-users] When is spec_helper.rb actually executed?

2008-10-08 Thread Wes Gamble
I'm trying to debug what I suspect is a case where spec_helper.rb is not being executed. I put a puts statement inside the Spec::Runner.configure do |config| block, and I can't ever see the printout. When does spec_helper.rb get run during rspec operation? Thanks, Wes -- Posted via http://www.r

Re: [rspec-users] Rspec: gem vs. plugin?

2008-10-08 Thread Wes Gamble
I, the OP, meant "rake spec". Sorry for the confusion. Craig Demyanovich wrote: On Wed, Oct 8, 2008 at 3:09 PM, Pat Maddox <[EMAIL PROTECTED] > wrote: To OP: you said that "rake spec" doesn't do anything...did you run "script/generate rspec" to get the rspec

Re: [rspec-users] When is spec_helper.rb actually executed?

2008-10-08 Thread Wes Gamble
Scott Taylor wrote: On Oct 8, 2008, at 6:26 PM, Wes Gamble wrote: I'm trying to debug what I suspect is a case where spec_helper.rb is not being executed. I put a puts statement inside the Spec::Runner.configure do |config| block, and I can't ever see the printout. When does spec

Re: [rspec-users] When is spec_helper.rb actually executed?

2008-10-08 Thread Wes Gamble
OK, got it. I have a follow-up question though. If a given spec DID NOT require spec_helper.rb, doesn't that imply that the spec would be run against the Rails "development" environment. I just did a test where I printed out the configuration of one of my classes DB connnections (e.g. Blah.co

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
David Chelimsky wrote: On Wed, Oct 8, 2008 at 3:41 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: Zach, Zach Dennis wrote: # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] = "

[rspec-users] What makes specs run against the test database?

2008-10-08 Thread Wes Gamble
I just did a test where I ran one spec and deep deep within the code under test, I printed out the DB connection of the AR class of a given object, like so: puts invoice.class.connection.inspect My spec requires spec_helper.rb, which supposedly sets the Rails environment to be "test". However, t

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
David Chelimsky wrote: On Wed, Oct 8, 2008 at 3:41 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: Zach, Zach Dennis wrote: # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] = "

Re: [rspec-users] What makes specs run against the test database?

2008-10-08 Thread Wes Gamble
Yes. Nick Hoffman wrote: On 2008-10-08, at 19:50, Wes Gamble wrote: I just did a test where I ran one spec and deep deep within the code under test, I printed out the DB connection of the AR class of a given object, like so: <..snip..> which shows that I am hitting my development da

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
David Chelimsky wrote: On Wed, Oct 8, 2008 at 6:42 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: David Chelimsky wrote: On Wed, Oct 8, 2008 at 3:41 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: Zach, Zach Dennis wrote: # This file is copied to ~/spec when y

Re: [rspec-users] Basic Rspec operation questions

2008-10-08 Thread Wes Gamble
Wes Gamble wrote: David Chelimsky wrote: On Wed, Oct 8, 2008 at 6:42 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: David Chelimsky wrote: On Wed, Oct 8, 2008 at 3:41 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: Zach, Zach Dennis wrote: # This file is copied to

[rspec-users] Verifying some understanding about manipulating DB data in before/after callbacks in RSpec

2008-11-06 Thread Wes Gamble
We had an after(:each) callback that looked like this: PurchaseOrder.find(:all).each {|po| DraftInvoice.find_all_by_po_number(po.po_number).each {|di| di.destroy}} which we were hoping would reset some purchase order data in a certain way. However, because we have "self.use_transactional_fix

Re: [rspec-users] Verifying some understanding about manipulating DB data in before/after callbacks in RSpec

2008-11-06 Thread Wes Gamble
Stephen Eley wrote: On Thu, Nov 6, 2008 at 4:32 PM, Wes Gamble <[EMAIL PROTECTED]> wrote: Attempting to manipulate data directly in the DB in a before/after callback doesn't make sense since those changes will not persist across tests because of the transactionality

Re: [rspec-users] class << self considered harmful... really?

2008-11-25 Thread Wes Gamble
Scott Taylor wrote I'd be interested, however, in hearing about the benefits of opening the eigenclass to define class methods (apart from ease in searching, which may be best handled with ctags). Grouping and private methods. Potentially dumb question: As far as private class methods, cou

Re: [rspec-users] Autotest and RSpect

2007-10-11 Thread Wes Gamble
Daniel, I ran into this as well - see my posts here: http://chrisdpratt.com/2007/09/04/rails-rspec-autotest-redgreen-and-snarl-reasons-i-dont-like-windows/ There's a bug in ZenTest: http://rubyforge.org/tracker/index.php?func=detail&aid=14203&group_id=419&atid=1678 The fix is to remove the sma

Re: [rspec-users] Autotest and RSpect

2007-10-11 Thread Wes Gamble
Oh one more thing, you need to remove the --colour option completely from your spec.opts. The other stuff can stay - don't know why, but it matters... Daniel Mantilla wrote: > Wes, I removed the spec.opts file and now I see the results of my specs, > but in plain text, no coloring. Well, at le

Re: [rspec-users] autotest displays no output

2007-10-31 Thread Wes Gamble
From a previous post - the bottom line is that even in Cygwin, File::ALT_SEPARATOR returns "\". In autotest.rb (under ZenTest/lib), the method named "ruby" which attempts to return the path to the executable doesn't work correctly on Windows. See below. I ran into this as well - see my posts

Re: [rspec-users] autotest displays no output

2007-10-31 Thread Wes Gamble
mains. > > Is there a way to output the final value of the ruby variable so I can check > if it matches the actual path to ruby? > > > Wes Gamble wrote: > >> From a previous post - the bottom line is that even in Cygwin, >> File::ALT_SEPARATOR returns "