Re: [rspec-users] Faking FS in specs

2011-03-14 Thread Scott Taylor
/File.html#M24 On Mar 13, 2011, at 2:37 PM, Nicholas Wieland wrote: hi Scott, thanks for the answer. https://gist.github.com/868356 I'm not even calling it inside the specs. ngw On Mar 13, 2011, at 5:28 PM, Scott Taylor wrote: How are you requiring FakeFS? Scott On Mar 13

Re: [rspec-users] Faking FS in specs

2011-03-13 Thread Scott Taylor
How are you requiring FakeFS? Scott On Mar 13, 2011, at 10:30 AM, Nicholas Wieland wrote: Hi *, for some reasons I'm not able to fake writing on the FS during specs with carrierwave, someone managed to make it work ? I'm currently trying to use FakeFS, but apparently I'm not even able to

Re: [rspec-users] [ANN] Welcome Chad, Pat, Justin, and Myron!

2011-03-01 Thread Scott Taylor
Welcome everyone (and double welcome to Pat)! Thanks for your hard work, guys! Cheers, Scott Taylor smtlaissezfaire On Mar 1, 2011, at 8:46 AM, David Chelimsky wrote: I'm very pleased to announce the reformation of a core RSpec development team: Chad Humphries, a.k.a. spicycode, has been

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] Is there a way to tell rspec not to fail the test while in debugger?

2011-02-03 Thread Scott Taylor
Probably manually rescuing your debugger call would work: begin debugger rescue Exception end Scott On Feb 3, 2011, at 9:18 AM, David Kahn wrote: I am curious as with Test::Unit I could go into the debugger and stay all day inside of a test and make all kinds of errors without a problem.

Re: [rspec-users] Is there a way to tell rspec not to fail the test while in debugger?

2011-02-03 Thread Scott Taylor
On Feb 3, 2011, at 12:04 PM, David Kahn wrote: On Thu, Feb 3, 2011 at 10:32 AM, David Chelimsky dchelim...@gmail.com wrote: On Feb 3, 2011, at 9:28 AM, David Kahn wrote: On Thu, Feb 3, 2011 at 8:48 AM, Scott Taylor sc...@railsnewbie.com wrote: Probably manually rescuing your debugger

Re: [rspec-users] Custom File List for Rails 3 Spec Task

2010-11-07 Thread Scott Taylor
: On Nov 6, 2010, at 5:04 PM, Scott Taylor wrote: I have some javascript specs (using the jspec javascript framework) in my rails 3 project, living in the spec/javascript directory. How can I exclude the ruby files in the jspec project from being run when I run rake spec? RSpec::Core::RakeTask

[rspec-users] Custom File List for Rails 3 Spec Task

2010-11-06 Thread Scott Taylor
I have some javascript specs (using the jspec javascript framework) in my rails 3 project, living in the spec/javascript directory. How can I exclude the ruby files in the jspec project from being run when I run rake spec? RSpec::Core::RakeTask used to take a file list (which was usually

Re: [rspec-users] Why pending only works inside it

2010-05-26 Thread Scott Taylor
On May 26, 2010, at 2:07 PM, Nadal wrote: I wrote following code and it did not work. describe User do it { should validate_presence_of(:email) } pending should raise an error when email is blank and record is saved with false option end Then I put pending inside it like one given

[rspec-users] Quickcheck testing framework

2010-05-16 Thread Scott Taylor
Hey all, I'm wondering if anyone has any experience with an automated test-case generation tool like Quickcheck (for erlang/haskell). I'd be interested in hearing any impressions, war stories, or dev workflows regarding a tool like this. Talking off list to David C, he suggested that it

Re: [rspec-users] Best practices for managing fixtures outside Rails?...

2010-05-16 Thread Scott Taylor
On May 14, 2010, at 8:25 PM, Stu wrote: Hi, I have a non-Rails Ruby project that uses RSpec. It needs a shared collection of fixture-like objects created, although they have nothing to do with Rails, AR or database entries: w1 = Widget.new(10) w2 = Widget.new(20) w3 = Widget.new(30)

Re: [rspec-users] Quickcheck testing framework

2010-05-16 Thread Scott Taylor
On May 16, 2010, at 8:13 PM, David Chelimsky wrote: On May 16, 2010, at 12:54 PM, Scott Taylor wrote: Hey all, I'm wondering if anyone has any experience with an automated test-case generation tool like Quickcheck (for erlang/haskell). I'd be interested in hearing any impressions, war

Re: [rspec-users] Writing rails plugins

2010-04-16 Thread Scott Taylor
On Apr 16, 2010, at 8:15 AM, Nicholas Wieland wrote: Hi *, I'm trying to write a plugin to integrate my SSO server into my rails app. I'm finding the whole process quite difficult, I'm still blocked at configuring rspec, and the lack of documentation is not helping. I've put this inside my

Re: [rspec-users] Testing a rails controller *outside* of spec/controllers

2010-03-10 Thread Scott Taylor
On Mar 11, 2010, at 1:26 AM, Nicolás Sanguinetti wrote: We have an app that has extensions that are built as rails engines. Each engine needs some code in the controllers, which we solved as include this module, call a method. In order to test it, though, we don't want to copy the test for

Re: [rspec-users] Testing a rails controller *outside* of spec/controllers

2010-03-10 Thread Scott Taylor
On Mar 11, 2010, at 1:26 AM, Nicolás Sanguinetti wrote: We have an app that has extensions that are built as rails engines. Each engine needs some code in the controllers, which we solved as include this module, call a method. In order to test it, though, we don't want to copy the test for

Re: [rspec-users] Best approach to spec'ing this

2010-02-22 Thread Scott Taylor
On Feb 22, 2010, at 1:54 PM, Matt Riches wrote: I am hoping that this is an easy question to answer! I have 2 models, related via an association model, such that models a and b use has_many to refer to each other, and also the association. has_many :through with an extra table, or HABTM?

Re: [rspec-users] Of ActiveRecord, arel, and train wrecks

2010-02-22 Thread Scott Taylor
On Feb 22, 2010, at 6:07 PM, Rick DeNatale wrote: I thought that it might be worth starting a discussion about the best approaches to deal with spec'ing what's becoming more and more common in apps using active record. It started with named scopes, now we have arel, and the old find calls

Re: [rspec-users] Error executing specs using Ruby 1.9.1p243 and RSpec 1.2.9

2009-11-23 Thread Scott Taylor
On Nov 23, 2009, at 9:35 PM, David Chelimsky wrote: On Fri, Nov 20, 2009 at 9:06 PM, Bogdan Dumitru dumbog...@gmail.com wrote: The syntax for use_fakefs changed in version 0.2.1 and the fixtures for rspec are generating errors, but it can be solved easily. Have to change ... describe smth

Re: [rspec-users] Error executing specs using Ruby 1.9.1p243 and RSpec 1.2.9

2009-11-23 Thread Scott Taylor
On Nov 23, 2009, at 11:12 PM, David Chelimsky wrote: On Mon, Nov 23, 2009 at 9:36 PM, Scott Taylor sc...@railsnewbie.com wrote: On Nov 23, 2009, at 9:35 PM, David Chelimsky wrote: On Fri, Nov 20, 2009 at 9:06 PM, Bogdan Dumitru dumbog...@gmail.com wrote: The syntax for use_fakefs

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Scott Taylor
On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like this: def some_method complex_method + other_complex_methods end private def complex_method... def other_complex_methods ... and the two

Re: [rspec-users] spec-ing private methods?

2009-10-14 Thread Scott Taylor
On Oct 14, 2009, at 4:24 PM, Nicolás Sanguinetti wrote: On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor sc...@railsnewbie.com wrote: On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: hello there, how do you tipically spec private methods? The thing is Ï have something like

Re: [rspec-users] stub! and stubs

2009-10-12 Thread Scott Taylor
On Oct 12, 2009, at 9:14 PM, David Chelimsky wrote: On Oct 12, 2009, at 9:37 PM, Sam Woodard wrote: I have an interesting setup: I am using rspec for mocking but I have mocha installed which give me access to any_instance, expects, etc. The problem that I am having is that I want to

Re: [rspec-users] Embarassingly simple mocking/speccing question

2009-09-17 Thread Scott Taylor
On Sep 17, 2009, at 3:13 PM, Chris Adams wrote: Hi there, Forgive the simple sounding question, but I'm struggling to understand how to spec helper methods in Rails work, and I'm having no joy, and after spending far, far too long staring at broken code, I'm hoping someone on the list

Re: [rspec-users] Embarassingly simple mocking/speccing question

2009-09-17 Thread Scott Taylor
Torrens Street London EC1V 1NQ email: ch...@stemcel.co.uk web: www.stemcel.co.uk twitter:chris_d_adams skype: chris.d.adams mob: 07974 368 229 tel: 0207 558 8971 2009/9/17 Scott Taylor sc...@railsnewbie.com On Sep 17, 2009, at 3:13 PM, Chris Adams wrote: Hi there, Forgive the simple sounding

Re: [rspec-users] Fixture replacement vs mock model

2009-09-02 Thread Scott Taylor
Jeremy Hageman wrote: Scott thanks for the insight. On Sep 1, 9:16 pm, Scott Taylor wrote: Most mocks used in a rails project server neither of these purposes. Primarily they are used for speed - which so far has been the primary trade off with using a fixture replacement

Re: [rspec-users] Fixture replacement vs mock model

2009-09-01 Thread Scott Taylor
Jeremy Hageman wrote: As someone relatively new to rspec, I am interested in hearing the wisdom of the group in the area of using a fixture replacement gem (such as machinist or factory girl) instead of mocking the model. To me it seems that using a fixture replacement, instead of a mock, would

Re: [rspec-users] metaprogrammatically generating spec examples

2009-08-25 Thread Scott Taylor
On Aug 25, 2009, at 6:39 PM, Joaquin Rivera Padron wrote: hey there, I have a question that may be raised from some misunderstanding of my current problem. But the answer might well serve me for other things. The issue is I would like to be able to metaprogramatically (this may be a

Re: [rspec-users] Fixtures not loading when running full test suite

2009-08-14 Thread Scott Taylor
On Aug 14, 2009, at 7:04 AM, Rob Aldred wrote: Hi, I've been trying to work this out for a while, im convinced its some local db configuration specific to my machine. When running `rake spec` 14 of my test fail all of them in the user_spec generated by restful auth. The error for all the

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread Scott Taylor
On Jul 13, 2009, at 12:09 PM, Adam Anderson wrote: I can't seem to find a good way to do this. If I stub out Time.now in one of my specs but need to return it to its original functionality then can I remove the stub? So I'd like to say something like: Time.stub!(:now).and_return(foo_time)

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread Scott Taylor
. You might also want to check out this library: http://github.com/notahat/time_travel/tree/master Scott -Adam On Mon, Jul 13, 2009 at 9:58 AM, Scott Taylor sc...@railsnewbie.com wrote: On Jul 13, 2009, at 12:09 PM, Adam Anderson wrote: I can't seem to find a good way to do this. If I stub

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread Scott Taylor
On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote: On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote: Thanks for the reply, Scott. What you describe is what is currently being done. now = Time.now Time.stub!(:now).and_return(foo_time) do_stuff Time.stub!(:now).and_return(now) However

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread Scott Taylor
On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote: On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylorsc...@railsnewbie.com wrote: On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote: On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote: Thanks for the reply, Scott. What you describe is what

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread Scott Taylor
On Jul 13, 2009, at 2:15 PM, Scott Taylor wrote: On Jul 13, 2009, at 2:12 PM, David Chelimsky wrote: On Mon, Jul 13, 2009 at 1:04 PM, Scott Taylorsc...@railsnewbie.com wrote: On Jul 13, 2009, at 1:46 PM, Scott Taylor wrote: On Jul 13, 2009, at 1:32 PM, Adam Anderson wrote: Thanks

Re: [rspec-users] explanation of describe vs context...

2009-07-12 Thread Scott Taylor
Chris Sund wrote: Hey everyone, This is a noob question. I'm not grasping the difference between describe and context in my spec file. As an example, what's the difference with this... describe Game do context starting up do it should send a welcome message do

Re: [rspec-users] Spork and Merb and rSpec

2009-06-15 Thread Scott Taylor
Andy Shipman wrote: When running spork on a merb application, whenever a spec is run I get the following error from the Spork server. /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.11/lib/merb-core/bootloader.rb:1358: [BUG] rb_gc_mark(): unknown data type 0x3c(0x2203d0) non object ruby

Re: [rspec-users] Spork and Merb and rSpec

2009-06-15 Thread Scott Taylor
On Jun 15, 2009, at 4:11 PM, Andy Shipman wrote: On 15 Jun 2009, at 14:43, Scott Taylor wrote: Andy Shipman wrote: When running spork on a merb application, whenever a spec is run I get the following error from the Spork server. /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0.11/lib/merb

Re: [rspec-users] Difference between spec:server and autospec

2009-06-04 Thread Scott Taylor
Hunt Jon wrote: What's the difference between spec:server and autospec? I wouldn't recommend using spec server - use spork instead: http://github.com/timcharper/spork/tree/master Both load the rails environment, so that each time you run your tests (with script/spec -X or script/spec

Re: [rspec-users] Difference between spec:server and autospec

2009-06-04 Thread Scott Taylor
. The *whole point* of the drb server is to speed up load time when running specs. Just to give you an idea, here's the difference for me (with spork instead of the spec server): http://screencast.com/t/qhRvqiXc Scott Can anybody explain to me, please? On Thu, Jun 4, 2009 at 3:24 PM, Scott

Re: [rspec-users] [rspec]spec_server: already initialized constant MyTestClass

2009-05-27 Thread Scott Taylor
David Chelimsky wrote: On Fri, May 1, 2009 at 12:26 PM, Matt Wynne m...@mattwynne.net wrote: I'm creating a class in my spec file to test out a module, but when I run the spec a second time in spec_server, I get the error above. I presume this is because rails is un-loading the class, and

Re: [rspec-users] Cucmber Step to insert Test Data into Database

2009-05-27 Thread Scott Taylor
David Chelimsky wrote: On Wed, May 27, 2009 at 5:20 AM, Smita Sreekanth li...@ruby-forum.com wrote: Hi, We run the feature created for a form to identify the fields and also to add data into the respective fields. But while running the cucumber features, all the scenario and steps are

Re: [rspec-users] [rspec]spec_server: already initialized constant MyTestClass

2009-05-27 Thread Scott Taylor
On May 27, 2009, at 4:59 PM, Matt Wynne wrote: On 27 May 2009, at 14:36, Scott Taylor wrote: David Chelimsky wrote: On Fri, May 1, 2009 at 12:26 PM, Matt Wynne m...@mattwynne.net wrote: I'm creating a class in my spec file to test out a module, but when I run the spec a second time

Re: [rspec-users] spec_server errors when reloading fixture replacement pl

2009-05-26 Thread Scott Taylor
On May 26, 2009, at 1:22 PM, Mark Wilden wrote: On Sun, May 24, 2009 at 10:17 PM, Ben Mabey b...@benmabey.com wrote: Well, so Spork was really created with testing in mind. It is more general purpose than spec_server though. You can use it with any Ruby project, not just Rails. You can

Re: [rspec-users] spec_server errors when reloading fixture replacement pl

2009-05-26 Thread Scott Taylor
On May 26, 2009, at 2:31 PM, Ben Mabey wrote: Scott Taylor wrote: On May 26, 2009, at 1:22 PM, Mark Wilden wrote: On Sun, May 24, 2009 at 10:17 PM, Ben Mabey b...@benmabey.com mailto:b...@benmabey.com wrote: Well, so Spork was really created with testing in mind. It is more

Re: [rspec-users] spec_server errors when reloading fixture replacement pl

2009-05-24 Thread Scott Taylor
Ben Mabey wrote: Scott Taylor wrote: Ben Johnson wrote: Did anyone ever figure out the factory_girl / machinist issues? I am having the same problems and can figure out how to fix it for the life of me. The first run works fine, then afterwards I get a bunch of these errors: No blueprint

Re: [rspec-users] spec_server errors when reloading fixture replacement pl

2009-05-22 Thread Scott Taylor
Ben Johnson wrote: Did anyone ever figure out the factory_girl / machinist issues? I am having the same problems and can figure out how to fix it for the life of me. The first run works fine, then afterwards I get a bunch of these errors: No blueprint for class Venue Any ideas? Thanks!

Re: [rspec-users] autotest?

2009-05-21 Thread Scott Taylor
Denis Haskin wrote: Thanks. Ok -- removing grosser-autotest lets autotest run, but it's only running my unit tests, not rspec: $ autotest (Not running features. To run features in autotest, set AUTOFEATURE=true.) loading autotest/rails /usr/bin/ruby1.8 -I.:lib:test -rubygems -e

Re: [rspec-users] autotest?

2009-05-21 Thread Scott Taylor
Kero van Gelder wrote: Is there some configuration I need to do to get rid of unit/functional tests and only run rspec+cucumber? [...] I guess I should add this in some form to the rspec wiki ;) Done: http://wiki.github.com/dchelimsky/rspec/autotest-integration +1.

Re: [rspec-users] autotest?

2009-05-20 Thread Scott Taylor
you now have), and rspec (and rspec-on-rails, if you are in a rails project). Aslak used to have some good abbreviation for this phrase: what versions of everything are you using? - rspec - rspec on rails (if in a rails project) - rails (if in a rails project) - OS Scott dwh Scott

Re: [rspec-users] autotest?

2009-05-19 Thread Scott Taylor
Denis Haskin wrote: Hmm. Okay, tried that but: $ autospec (Not running features. To run features in autotest, set AUTOFEATURE=true.) loading autotest/rails_rspec Autotest style autotest/rails_rspec doesn't seem to exist. Aborting. I'm running my rails rspec examples just fine manually...

Re: [rspec-users] Running single spec files -- how?

2009-05-11 Thread Scott Taylor
On May 11, 2009, at 7:10 PM, court3nay wrote: Before upgrading from 1.1.11 to 1.2.4 I used to be able to do this: ruby spec/models/user_spec.rb I would assume that would work if you are requiring test-unit interop mode. I believe in previous versions of rspec it was automatically

Re: [rspec-users] Weird bug in association extensions

2009-05-09 Thread Scott Taylor
court3nay wrote: Hey all, just upgraded an older app to latest rspec and rails. This code runs fine in console but fails under rspec. class User has_many :statuses, :extend = Status:::AssociationExtension end module Status::AssociationExtensions def after(status)

Re: [rspec-users] Help with global before behavior...

2009-05-08 Thread Scott Taylor
Denis Haskin wrote: I'm having a devil of a time getting some global before behavior to work the way I think it should. I have a set of controllers that are used only by administrative users, so login is required. To run examples just against the functionality, ideally I'd like to be able

Re: [rspec-users] Mocha and rspec_scaffold

2009-05-07 Thread Scott Taylor
On May 7, 2009, at 7:32 AM, jevado wrote: Hi All, I'm busy experimenting with RSpec and encountered a small issue with the scaffolding. As soon as I chooce mocha as my mocking framework in the spec helper the specs created with rspec_scaffold fail. Is this a bug or do the rspec_generators

Re: [rspec-users] submodule rspec and rspec-rails issues

2009-04-30 Thread Scott Taylor
On Apr 30, 2009, at 2:26 PM, Amos King wrote: I started a brand new rails app and then ran the following. %git submodule add git://github.com/aslakhellesoy/cucumber.git vendor/plugins/cucumber %git submodule add git://github.com/brynary/webrat.git vendor/ plugins/webrat %git submodule add

Re: [rspec-users] possible to stub params hash ?

2009-04-08 Thread Scott Taylor
On Apr 8, 2009, at 11:09 AM, Andrea Jahn wrote: Hi, I added one line in my controller to extend the params hash. But now I get errors in my controller spec. Controller def update @pl_planning = PlPlanning.find(params[:id]) # the item model version (select box) depends on

Re: [rspec-users] [Rspec] Trying to get rspec to test a controller in a namespace

2009-04-07 Thread Scott Taylor
On Apr 7, 2009, at 7:47 AM, TimBooher wrote: I am trying to get my workflow down and am confused on several fronts. The first is how to get my rspec_scaffold tests to run. The problem is that i generated my scaffold, then moved my controller into a namespace named :admin. So I have the

Re: [rspec-users] debuggin cucmber script in ruby

2009-04-07 Thread Scott Taylor
On Apr 7, 2009, at 11:54 AM, Ben Mabey wrote: On Apr 7, 2009, at 8:30 AM, aidy lewis wrote: On 07/04/2009, Zach Dennis zach.den...@gmail.com wrote: On Mon, Apr 6, 2009 at 12:21 PM, Ben Mabey b...@benmabey.com wrote: My best suggestion would be to set multiple breakpoints and hit c to

Re: [rspec-users] rake db:test:prepare and pending migrations

2009-04-07 Thread Scott Taylor
On Apr 7, 2009, at 1:32 PM, James B. Byrne wrote: I have run into a minor glitch and would like to know what others think. I am working on a test/expectation and as part of the process of debugging I am rolling back db:migrations one step at a time to discover where the problem was

Re: [rspec-users] Web-based story runner?

2009-04-07 Thread Scott Taylor
On Apr 7, 2009, at 4:26 PM, Sophie (itsme213) wrote: Some time ago I had come across a web-based story editor for scenarios. I'm not sure if it was a full runner, and it was probably before cucumber. Anyone know where I can find it? Aslak had a prototype a while back - although it was

Re: [rspec-users] [Cucumber] Welcome Ben Mabey to the official Cucumber team

2009-04-07 Thread Scott Taylor
On Apr 7, 2009, at 5:19 PM, aslak hellesoy wrote: Ben Mabey has accepted my invitation to be on the core Cucumber team. Ben has been a long time contributor to Cucumber's ecosystem and knows it inside out. Here is a quote from IRC today: mabes: Yeah but you're the cucumber God. The core

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Scott Taylor
On Mar 31, 2009, at 12:08 PM, Fernando Perez wrote: Hi, I just ran into this issue. I have a method that returns: false, true, nil or an object. This method is used by another method to test for true/false. In Ruby that's easy to handle as nil and false evaluate to false, and everything

Re: [rspec-users] autospec fails but rake spec tasks pass

2009-03-30 Thread Scott Taylor
On Mar 27, 2009, at 4:38 PM, jakepaul wrote: I can't figure out what is causing this problem. I'm using the latest rspec and rspec-rails gems on rails 2.3.2. When I run autospec, the tests in the model spec that I am editing will all fail. The error messages are like this:

Re: [rspec-users] spec_server not reloading model classes

2009-03-29 Thread Scott Taylor
, which is how they come out of the box... I was thinking of any explicit requires which may occur in app/ and lib/. AFAIK, this is more of a rails loading issue than an rspec one. Scott Thanks for your help, Andrew On Mar 29, 12:12 am, Scott Taylor sc...@railsnewbie.com wrote: Andrew

Re: [rspec-users] Rspec weird behaviour

2009-03-23 Thread Scott Taylor
andrea wrote: Hi, I recently migrated from classic rails testing to Rspec, so I am pretty new to the framework and still learning. I am getting weird errors on an ActiveRecord model test, here is the basic class model definition: class Size ActiveRecord::Base has_many :quantities, :dependent

Re: [rspec-users] [rspec] Stubbing partials in view specs / Test Spy

2009-03-19 Thread Scott Taylor
On Mar 19, 2009, at 10:30 AM, David Chelimsky wrote: On Mar 19, 2009, at 7:59 AM, Evgeny Bogdanov evgeny.bogda...@gmail.com wrote: just upgraded to 1.2.0 the following code works now: template.stub!(:render).with(hash_including(:partial = children/ child))

Re: [rspec-users] How to use different mocking frameworks?

2009-03-15 Thread Scott Taylor
Val wrote: Okay. Thanks for your responses. I guess I'll try splitting them into separate directories. Will each directory automatically include it's own spec_helper.rb? Are you using any features from one mock framework that aren't present in the other? If not, potentially you could,

Re: [rspec-users] [rspec/tm] When running the textmate bundle hook using command-r I get an error about missing rubygems

2009-03-13 Thread Scott Taylor
David Chelimsky wrote: On Sat, Mar 7, 2009 at 3:03 PM, Nathaniel Brown n...@inimit.com wrote: I get the following error using both edge version of the TM bundle and rspec/rspec-rails in vendor/plugins. /Users/nshb/Library/Application Support/TextMate/Bundles/

Re: [rspec-users] Spec'ing chained calls

2009-03-13 Thread Scott Taylor
Levy Carneiro Jr. wrote: Hello! I'm trying to spec a method, that has several chained calls. http://gist.github.com/78562 (spec) http://gist.github.com/78563 (model) In the first spec, I'm trying to focus on the method calls that have to be made, and the arguments they should receive. Is

Re: [rspec-users] How do you use pending in RSpec?

2009-03-12 Thread Scott Taylor
On Mar 12, 2009, at 5:50 PM, Bill Venners wrote: Hi All, I've been working on BDD support in a test framework for Scala imaginatively called ScalaTest, and I want to add support for the notion of pending examples. I see three different forms of pending in RSpec, and I'm curious to hear which

Re: [rspec-users] How do you use pending in RSpec?

2009-03-12 Thread Scott Taylor
Bill Venners wrote: Hi Aslak and Scott, Thanks for your replies. I have a couple quick follow up questions. On Thu, Mar 12, 2009 at 3:05 PM, aslak hellesoy aslak.helle...@gmail.com wrote: On Thu, Mar 12, 2009 at 10:50 PM, Bill Venners b...@artima.com wrote: Hi All, I've been working

Re: [rspec-users] Question on SQL exceptions

2009-03-09 Thread Scott Taylor
On Mar 9, 2009, at 4:53 PM, James Byrne wrote: Pat Maddox wrote: ActiveRecord doesn't know anything about db constraint errors. If one is violated, the error propagates up in the form of an exception. I realize that, but the exception is of the ActiveRecord:StatementInvalid class, which

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Scott Taylor
Phlip wrote: The question is why did RSpec throw away the backtrace? Am I the first person in history to hit a programming error inside RSpec?? Nope, but this probably isn't one of them. I said it wrong. The complete venting goes Am I the first person in history to use RSpec, and then hit

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Scott Taylor
Phlip wrote: Tero Tilus wrote: Line 192 contains neither a stray nil nor a method 'macro'. So what exactly _is_ there? Do you know that particular line causes (or noes not cause) the error? Test::Unit::TestCase said the error was ~20 layers deeper - but exactly below the same to_xml()

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-06 Thread Scott Taylor
Phlip wrote: Here's an error message. The details are not important (beyond to_xml on a virtual AR database via fixture_dependencies). I know how to work the actual problem. NoMethodError in 'BlogMindMap should create XML' undefined method `macro' for nil:NilClass

Re: [rspec-users] OT: AR Default Values

2009-03-04 Thread Scott Taylor
On Mar 4, 2009, at 12:16 PM, James Byrne wrote: This is sort of off topic but it arose from a cucumber test failure and I am unsure how to address the underlying issue. I spent yesterday tracking down an obscure error that was exposed by a new cucumber test. It turned out to be an improper

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Scott Taylor
On Feb 27, 2009, at 11:41 AM, Matt Wynne wrote: On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails Cucumber spec in a different DB than the test DB? I'd like to run the rspec and cucumber tests

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-27 Thread Scott Taylor
On Feb 27, 2009, at 12:01 PM, Matt Wynne wrote: On 27 Feb 2009, at 16:54, Scott Taylor wrote: On Feb 27, 2009, at 11:41 AM, Matt Wynne wrote: On 26 Feb 2009, at 18:27, Scott Taylor wrote: On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails

Re: [rspec-users] Run cucumber on a different DB than test?

2009-02-26 Thread Scott Taylor
On Feb 26, 2009, at 1:19 PM, Forrest Chang wrote: Hi all: Is it possible to run Rails Cucumber spec in a different DB than the test DB? I'd like to run the rspec and cucumber tests in parallel in my cc.rb build, and as it is now, I get MYSQL deadlocks on occasion. I could serialize

Re: [rspec-users] Is #valid? automatically called?

2009-02-13 Thread Scott Taylor
On Feb 13, 2009, at 10:52 AM, Nick Hoffman wrote: On 12/02/2009, at 2:59 PM, David Chelimsky wrote: On Feb 12, 2009, at 1:03 PM, Nick Hoffman n...@deadorange.com wrote: Does RSpec automatically call #valid? on ActiveRecord models? For instance, when this example is run: it 'should

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Scott Taylor
Mark Wilden wrote: It seems logical that #errors_on would call valid? Otherwise, how would it know? That intuitively makes sense. The reason the whole issue is confusing is because of AR's behaviour: User.new.valid? = false User.new.errors.to_a = [] errors_on(:foo) looks like it'll

Re: [rspec-users] Rspec approach to test model

2009-02-11 Thread Scott Taylor
On Feb 11, 2009, at 8:51 AM, Kaleem Ullah wrote: Hi, I am quite new to Rspec. I want to use Rspec to test my existing Code. I start from Models (Unit Testing). Here i want your help on a issue. Here is model/user_spec.rb describe User do before(:each) do @user=User.new

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-08 Thread Scott Taylor
Jim Morris wrote: Yet another way to do fixtures/factories is a hybrid that I outline in my blog, its basically what I do. http://blog.wolfman.com/posts/42 Basically I can't use the existing libraries as I am not using ActiveRecord. I'd be interested in supporting Datamapper, Sequel, and

Re: [rspec-users] Fixjour and others

2009-02-08 Thread Scott Taylor
or other, like in my case not using ActiveRecord. So I came up with yet another way to do it, I think it is a hyvrid between Fixtures and Factories. outlined here... http://blog.wolfman.com/posts/42 On Feb 7, 8:16 am, Jay Levitt lists-rs...@shopwatch.org wrote: Scott Taylor wrote

Re: [rspec-users] How to return a value passed by ref to a method

2009-02-08 Thread Scott Taylor
Remi Gagnon wrote: Hi, I have a recursive method and I want to mock a var passed by ref. Object.should_receive(:my_method).and_returnby_ref(@value) Often a way to spec a recursive function is to alias it, and have the recursive call call the alias. So if you want to check the recursion,

Re: [rspec-users] Fixjour and others

2009-02-06 Thread Scott Taylor
Juanma Cervera wrote: Hello I have seen that some people in this list is using Fixjour as the replacement of fixtures. But I can't understand why it is superior or better than other approaches to the subject like Machinist o FactoryGirl. What are the problems this library resolve? Can somebody

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-06 Thread Scott Taylor
On Feb 6, 2009, at 12:50 PM, Stephen Eley wrote: On Fri, Feb 6, 2009 at 12:17 PM, Fernando Perez li...@ruby- forum.com wrote: The next big step will be specing controllers, as it is more painful than models, but now that my controllers are ripped I guess it will be easier. I've stopped.

Re: [rspec-users] [OT] Object Mother vs Test Data Builder (was Jay Fields' blog on developer testing)

2009-02-05 Thread Scott Taylor
Nat points out that problems with Object Mother arise when people start adding factory methods to deal with the edge cases, such as ObjectMother.new_invoice_with_no_postal_code. I totally agree that this would be a problem since such abstraction results in hard to follow tests (this is

Re: [rspec-users] [Rspec] How do you nest before(:all) or after(:all) blocks?

2009-02-04 Thread Scott Taylor
John Kolokotronis wrote: Hi all, I'm new to Rspec but loving it so far and looking to use it as a replacement for a Test::Unit framework I have which drives a web app via Watir. So far, things have worked very well with Rspec but I can't get my head around how before/after(:all) blocks would

Re: [rspec-users] Trouble validating an exception

2009-02-02 Thread Scott Taylor
On Feb 2, 2009, at 6:30 PM, Ben Greenberg wrote: Hi all, This spec always passes: lambda do process_card @credit_card, billing_info, 10604, '1.1.1.1', @gateway end.should raise_error(MinimalCart::CaptureFailureError) do |ex| ex.should be_nil ex.should_not be_nil

Re: [rspec-users] Trouble validating an exception

2009-02-02 Thread Scott Taylor
On Feb 2, 2009, at 6:30 PM, Ben Greenberg wrote: Hi all, This spec always passes: lambda do process_card @credit_card, billing_info, 10604, '1.1.1.1', @gateway end.should raise_error(MinimalCart::CaptureFailureError) do |ex| ex.should be_nil ex.should_not be_nil

[rspec-users] session vs. controller.session

2009-01-29 Thread Scott Taylor
What exactly is the difference between using controller.session and session? I though that session was just a proxy controller.session, but this irb/debug sessions show that it isn't: http://gist.github.com/54673 When I call reset_session in the controller, I'm seeing the controller's

Re: [rspec-users] session vs. controller.session

2009-01-29 Thread Scott Taylor
On Jan 29, 2009, at 1:57 PM, Scott Taylor wrote: What exactly is the difference between using controller.session and session? I though that session was just a proxy controller.session, but this irb/debug sessions show that it isn't: http://gist.github.com/54673 When I call

Re: [rspec-users] testing capistrano tasks

2009-01-28 Thread Scott Taylor
On Jan 28, 2009, at 10:01 AM, Mike Gaffney wrote: We actually have a machine that is a perfect clone of the production machine. The only difference is the passwords. We test all deployments to it first. We call it staging. Having a staging has 2 benefits: 1) We can test our deployment

Re: [rspec-users] specs run faster separately than together

2009-01-28 Thread Scott Taylor
On Jan 28, 2009, at 3:21 PM, Jeremy Lightsmith wrote: So this is weird. on my current project I've been working on speeding up specs, and I just found that time rake spec = 4m 0s whereas time rake spec:controllers spec:models spec:helpers spec:lib = 2m 32s Do those rake tasks run rake

Re: [rspec-users] webrat methods are undefined

2009-01-28 Thread Scott Taylor
On Jan 28, 2009, at 4:49 PM, Tom Hoen wrote: Zach Dennis wrote: This will probably still break in webrat HEAD, I am using this branch right now which includes a fix that is not in HEAD (it's waiting to be merged, or for another solution to take effect):

Re: [rspec-users] testing capistrano tasks

2009-01-27 Thread Scott Taylor
be a backup no more than 10 minutes old And the backup should restore OK And the restored database should contain the same records as the original database On 27 Jan 2009, at 03:31, Scott Taylor wrote: Does anyone have any insight into testing capistrano tasks? More specifically, I'm

[rspec-users] testing capistrano tasks

2009-01-26 Thread Scott Taylor
Does anyone have any insight into testing capistrano tasks? More specifically, I'm looking to add regression tests to this package, which adds database backup tasks to capistrano: http://github.com/smtlaissezfaire/cap_db_dump/tree/master Scott

Re: [rspec-users] fixture_scenarios problem

2009-01-21 Thread Scott Taylor
Giuseppe Bertini wrote: Hello there, is anyone still using fixture_scenarios with RSpec these days? They don't seem to coexist peacefully anymore. I just created a new rails (2.2.2) app, generated an rspec_scaffold (with v. 1.1.12), and verified that all specs pass. But if I then install the

Re: [rspec-users] [Rails, RSpec] The config.gem rake task chicken and egg thing

2009-01-19 Thread Scott Taylor
Matt Wynne wrote: Sorry folks, because I know this has been asked before but I don't remember anyone giving enough detail for me to sort this out the way I want to. How do I change my rake tasks to silently fail if they can't require rspec? I can do this: begin require

[rspec-users] gem installation issues

2009-01-19 Thread Scott Taylor
I'm getting the following error when trying to install rspec: scott-taylors-macbook-pro:dl_forms(specs) smt$ sudo gem install rspec Password: ERROR: Error installing rspec: invalid gem format for /usr/local/ruby_versions/1_8_6/lib/ruby/gems/1.8/cache/rspec-1.1.12.gem Are the gems no

  1   2   3   4   >