Re: [rspec-users] State of autospec/test and Rails 3

2010-04-14 Thread Mikel Lindsaar
On 14, April 2010, at 14 Apr 23:37, David Chelimsky wrote: > On Apr 14, 2010, at 7:37 AM, Mikel Lindsaar wrote: >> I saw a thread or a blog post, I think it was on your site David, that >> Autotest is not working with Rails at the moment, circa beta4. > I'm having success

[rspec-users] State of autospec/test and Rails 3

2010-04-14 Thread Mikel Lindsaar
Hi all, David, before I begin, thanks for your hard work :) I saw a thread or a blog post, I think it was on your site David, that Autotest is not working with Rails at the moment, circa beta4. Has that since changed? If not, anything I can do to help? At least on beta6 it still seems to be f

Re: [rspec-users] Best way to match several attributes of an object?

2010-04-08 Thread Mikel Lindsaar
>> When you need to check several properties of an object, what is the >> best way to match them all? In the mail library I use a custom matcher, which lets me do things like: it "should handle |Minero Aoki |" do address = Mail::Address.new('Minero Aoki ') address.should break_down_to({

[rspec-users] RSpec and 1.9 Compatibility

2008-12-06 Thread Mikel Lindsaar
OK... I am making a mail library that is taking advantage of the new things in 1.9, mainly encoding and the new regex goodness. However, RSpec is not jiggy with it right now on 1.9... so I'm going to try and scratch an itch here. Has anyone started on this? I've started in terms of getting RSpec

Re: [rspec-users] Indentation Conventions for Ruby and Cucumber

2008-12-06 Thread Mikel Lindsaar
On Thu, Dec 4, 2008 at 1:27 AM, Andrew Premdas <[EMAIL PROTECTED]> wrote: > Oh but cucumber features so want to be idented on the I > > Scenario: Anonymous user can not duplicate a un-activated account >Given I am an anonymous user > And a registered user Fred exists > When I signup

[rspec-users] Indentation Conventions for Ruby and Cucumber

2008-12-03 Thread Mikel Lindsaar
On Thu, Nov 27, 2008 at 4:28 PM, Aslak Hellesøy <[EMAIL PROTECTED]>wrote: > When (if) this thread ends, let's start a discussion about indentation > conventions! > Oh... let the pleasure be mine!... and why wait? _EVERYONE_ knows that the only way to indent ruby code is 2 plain spaces. Tabs are

[rspec-users] Ruby 1.9 - autospec loadpath problem

2008-11-30 Thread Mikel Lindsaar
Mac OSX 10.5.5(Ruby 1.8.6 installed already) I installed Ruby 1.9.1 preview thusly: == port install readline cd ruby-1.9.1-preview1 ./configure --program-suffix=-trunk --with-readline-dir=/usr/local make make install

Re: [rspec-users] SOLVED Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
On Thu, Nov 27, 2008 at 12:54 AM, David Chelimsky <[EMAIL PROTECTED]>wrote: > Ouch! > > Good lesson though. Keep your test data close, and your mocks and stubs > closer. > > Thanks for reporting and congrats on being able to move on :) Yeah... finding it involved walking through the entire call

Re: [rspec-users] SOLVED Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
Hands up all the people in here who feel stupid Thanks. Problem was that I had an errant stub!(:notify) in a factory method. That factory method was only called on certain classes. Those classes were the ones failing. My bad. -- http://lindsaar.net/ Rails, RSpec and Life blog

Re: [rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
OK, in the app I have some name spaced classes under a 'int' directory. Some of these classes have observers and they have the same name as the top level classes. If I make a new observer in the top level that shares a name with an observer inside the namespace, the specs work. If I create an ob

Re: [rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
And the weirdness continues... Making a new observer against a different (empty) model works as expected. Deleting the entire person model down to just the class declaration, still does not work. >:| -- http://lindsaar.net/ Rails, RSpec and Life blog ___

Re: [rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
On Wed, Nov 26, 2008 at 10:10 PM, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > Am I missing a load path somewhere? > OK, I've ruled this out. I did: class PersonObserver < ActiveRecord::Observer raise end $ ruby spec/observers/person_observer.rb Throws an excepti

Re: [rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
On Wed, Nov 26, 2008 at 9:41 PM, David Chelimsky <[EMAIL PROTECTED]>wrote: > On Wed, Nov 26, 2008 at 4:32 AM, Mikel Lindsaar <[EMAIL PROTECTED]> > wrote: > > Sorry David, stupid typo. I am duplicating the text from another screen > > that is not on the 'net

Re: [rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
> I see two examples with identical code. Do they both fail, or just the > 2nd one? If so, there was a bug in which mocked inherited class > methods were not properly restored after the example. This is fixed in > git, but not released. > > Would you mind building the gem from the latest and see if

[rspec-users] Observer not calling inside a spec

2008-11-26 Thread Mikel Lindsaar
OK, I can't figure this out. RSpec 1.1.8 RSpecRails 1.1.8 Rails 2.1.1 I have a model #app/models/person.rb class Person < ActiveRecord::Base # The model has a lot of code in it, but even deleting # all the contents down to an empty model like this # still produces the error end #app

Re: [rspec-users] Cucumber - how to spec a quick search box

2008-11-19 Thread Mikel Lindsaar
On Wed, Nov 19, 2008 at 1:32 PM, Bryan Helmkamp <[EMAIL PROTECTED]> wrote: > If the form tag has an ID, you can use Webrat' new submit_form method > to do just this sort of thing. > Not wrong about being new :) 24 hours ago... recent enough not to be in the History.txt file and I had to go hunti

[rspec-users] Cucumber - how to spec a quick search box

2008-11-18 Thread Mikel Lindsaar
Hello all. Wondering if anyone else has solved this. Some websites (including the intranet app I am working on) have a form in the top corner of the site that is buttonless. If you focus on this form enter text and hit enter, it submits. usually used for quick search boxes. Question, has anyone

Re: [rspec-users] rake features and cucumber feature/name not producing same result

2008-11-06 Thread Mikel Lindsaar
On Thu, Nov 6, 2008 at 11:28 PM, Joseph Wilk <[EMAIL PROTECTED]>wrote: > If you are using cucumber with rails and used the rails generator you > should find in your generated features/steps/env.rb file (In the latest > cucumber version 0.1.9 this is in features/support/env.rb): > Yes, I was alre

Re: [rspec-users] rake features and cucumber feature/name not producing same result

2008-11-05 Thread Mikel Lindsaar
On Thu, Nov 6, 2008 at 2:53 AM, Joseph Wilk <[EMAIL PROTECTED]>wrote: > I'm getting expected: "1" >> got: "0" >> on a simple should change(Model, :count).by(1) >> >> It follows the specific model around as well. If I change order of the >> fit table or not (the fit table h

Re: [rspec-users] rake features and cucumber feature/name not producing same result

2008-11-05 Thread Mikel Lindsaar
On Wed, Nov 5, 2008 at 7:10 PM, Matt Wynne <[EMAIL PROTECTED]> wrote: > On 5 Nov 2008, at 03:58, Mikel Lindsaar wrote: > > If I run rake features or cucumber features/* I get one failing FIT >> scenario in one of my features. >> If I then run that feature that cont

[rspec-users] rake features and cucumber feature/name not producing same result

2008-11-04 Thread Mikel Lindsaar
Hi all. If I run rake features or cucumber features/* I get one failing FIT scenario in one of my features. If I then run that feature that contains the FIT table with the failing scenario manually, it passes. I run it again with rake features or cucumber features/* it fails, run individually, it

Re: [rspec-users] Cucumber / Webrat clicks_button problem

2008-10-10 Thread Mikel Lindsaar
Never mind, fixed in trunk of Webrat. On Fri, Oct 10, 2008 at 5:07 AM, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > Before I dive into the code and fix it, has anyone else worked around > / found the solution to calling 'clicks_button' when the button is > actually

[rspec-users] Cucumber / Webrat clicks_button problem

2008-10-09 Thread Mikel Lindsaar
Before I dive into the code and fix it, has anyone else worked around / found the solution to calling 'clicks_button' when the button is actually a button and not an input? ie: Text... / Image here Calling clicks on this doesn't find it as webrat only looks for input[type=submit]. Mikel

[rspec-users] Best place to set load path for new spec folders

2008-10-05 Thread Mikel Lindsaar
I have a bunch of observers in RAILS_ROOT/spec/observers/ as well as in some sub directories for some name spaced observers. For example: \spec \observers person_observer_spec.rb \admin user_observer_spec.rb autospec doesn't seem to want to pick them up. The box I

Re: [rspec-users] How do BOTH these examples pass?

2008-10-01 Thread Mikel Lindsaar
On Wed, Oct 1, 2008 at 11:26 PM, Ashley Moran <[EMAIL PROTECTED]> wrote: > *does* pass the specs, both the one that says parse should be called, and > the one that say it shouldn't! But why? I'm prepared to admit I'm just > missing something really really really obvious (it happens often), but ho

Re: [rspec-users] How do BOTH these examples pass?

2008-10-01 Thread Mikel Lindsaar
On Wed, Oct 1, 2008 at 1:02 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > RssReader when there is an HTTP error > - should attempt to parse the RSS > - should not attempt to parse the RSS > - should fail gracefully >From what I can see, your code error is not doing anything with the caught except

Re: [rspec-users] [ANN] RSpec-1.1.5 has been released

2008-09-29 Thread Mikel Lindsaar
On Mon, Sep 29, 2008 at 9:01 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: Nice :) -- http://lindsaar.net/ Rails, RSpec and Life blog ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [ANN] RSpec-1.1.5 has been released

2008-09-28 Thread Mikel Lindsaar
On Mon, Sep 29, 2008 at 12:07 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > RSpec-1.1.5 has been released rspec_team.should_receive(:thank_you).at_least(:once) GmailMailer.post(email) -- http://lindsaar.net/ Rails, RSpec and Life blog ___ rspec

Re: [rspec-users] RSpec sundry questions

2008-09-09 Thread Mikel Lindsaar
On Wed, Sep 3, 2008 at 7:05 AM, Greg Hauptmann <[EMAIL PROTECTED]> wrote: > Q2 - Anyone know where the "build" method that Ryan used in his Rails > cast? Was this a mocha method? (I couldn't see it in the api). > Reference: http://railscasts.com/episodes/81-fixtures-in-rails-2-0 No, I skimmed th

Re: [rspec-users] Writing specs for a module

2008-09-06 Thread Mikel Lindsaar
On Thu, Sep 4, 2008 at 4:26 AM, Pat Maddox <[EMAIL PROTECTED]> wrote: > On Wed, Sep 3, 2008 at 1:57 PM, Nick Hoffman <[EMAIL PROTECTED]> wrote: >> I'm writing specs for a module for my Rails app. The module will live in >> lib/ . For now, I've created the directory spec/lib/ to store the specs for

[rspec-users] Spec'ing correct use of Timeout

2008-08-02 Thread Mikel Lindsaar
Heya all, I have an interesting case that I would like to bounce off the list. I have a separate thread going in ruby-talk about Timeout.timeout still running after the timeout specified. The spec on this has been the classic 'I didn't write it, so I won't spec it' and so using mocks and stubs.

Re: [rspec-users] Specing a rails monkey patch

2008-07-23 Thread Mikel Lindsaar
Sorry, hit the tab and enter key too soon :) You'd stub out the model. class DummyModel acts_as_curseable end it "should ask the database to set up a transaction" do DummyModel.connection.should_receive("BEGIN;").once ... then the execution code to make that happen end it "should ask the

Re: [rspec-users] Specing a rails monkey patch

2008-07-23 Thread Mikel Lindsaar
On Mon, Jul 21, 2008 at 6:38 PM, Keith McDonnell <[EMAIL PROTECTED]> wrote: > I /could/ use an SQL cursor but: > I don't know if these are valid reasons however :) The only thing you gain with a direct SQL cursor is the guarantee of hitting each row exactly once without having to pull down all the

Re: [rspec-users] Specing a rails monkey patch

2008-07-19 Thread Mikel Lindsaar
On Fri, Jul 18, 2008 at 8:11 PM, Keith McDonnell <[EMAIL PROTECTED]> wrote: > I wrote an ActiveRecord extension to emulate a db cursor: > http://pastie.org/236367 > As you can see, the spec doesn't really ensure that the records are fetched > in chunks. I'd like to mock the call to AR find and ensu

Re: [rspec-users] auto-generated descriptions

2008-07-04 Thread Mikel Lindsaar
On Sat, Jul 5, 2008 at 12:18 PM, Steve Eley <[EMAIL PROTECTED]> wrote: > On Fri, Jul 4, 2008 at 4:45 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> So - how bad do you think this would suck to remove that feature? Are you >> using it yourself? > I'm not, but would it be impractical to extract it

Re: [rspec-users] Global setup method goes where?

2008-07-03 Thread Mikel Lindsaar
On Fri, Jul 4, 2008 at 4:19 PM, Ben Mabey <[EMAIL PROTECTED]> wrote: > Gregg Pollack wrote: >> I found this post which shows how to get test information printed out in >> your test.log with test:unit and shoulda, but I'm not sure there's a way >> to do it with RSpec. Damn, that is a good idea. >

Re: [rspec-users] How to detect an attribute rename from a view spec?

2008-07-03 Thread Mikel Lindsaar
On Fri, Jul 4, 2008 at 10:23 AM, Ben Teese <[EMAIL PROTECTED]> wrote: > I'm new to RSpec so excuse me if I'm missing something obvious here. I > recently renamed an attribute on a model, and my generated view spec didn't > detect it. This resulted in a defect going through undetected. Even worse, >

Re: [rspec-users] (no subject)

2008-07-03 Thread Mikel Lindsaar
On Thu, Jul 3, 2008 at 10:22 PM, Joseph Leddy <[EMAIL PROTECTED]> wrote: > > > Sent from my mobile I assume this is a pending spec? :) -- http://lindsaar.net/ Rails, RSpec, Puppet and Life blog ___ rspec-users mailing list rspec-users@rubyforge.or

Re: [rspec-users] Attempting to Make Sense of RSpec use

2008-07-03 Thread Mikel Lindsaar
On Fri, Jul 4, 2008 at 8:32 AM, Tiffani Ashley Bell <[EMAIL PROTECTED]> wrote: > Hi everybody, Hi Tiffany, welcome to Rspec > I was reading the Typo source code, however, and came across some code that > I didn't know exactly how it worked. I've noticed that in testing one of > their controllers

Re: [rspec-users] Stopping example execution?

2008-06-29 Thread Mikel Lindsaar
On Mon, Jun 30, 2008 at 2:59 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jun 29, 2008, at 11:38 AM, Britt Mileshosky wrote: >>> My instinct about this is that it would encourage long methods because >>> it would make it less painful to test them, so I would be adverse to >>> anything that l

Re: [rspec-users] Dealing with dependent data

2008-06-26 Thread Mikel Lindsaar
On Fri, Jun 27, 2008 at 1:25 AM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: > On 26-jun-2008, at 15:48, David Chelimsky wrote: >> On Jun 25, 2008, at 9:38 PM, Mikel Lindsaar wrote: >>> http://www.lindsaar.net/2008/6/24/tip-24-being-clever-in-specs-is-for-dummies >>

Re: [rspec-users] Dealing with dependent data

2008-06-25 Thread Mikel Lindsaar
On Thu, Jun 26, 2008 at 12:18 PM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > The other thing I'm finding a lot is that I have a lot of the same > needs for this fixture type data between my regular RSpec examples > (model tests mostly, as I'm going light on controller and view tests > and most

Re: [rspec-users] Dealing with dependent data

2008-06-25 Thread Mikel Lindsaar
On Thu, Jun 26, 2008 at 4:37 AM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > If there's already been a thread on this, let me know (and if you can, > point me to it)... I asked something similar about a week or so ago, you can see it here: http://www.ruby-forum.com/topic/156392 It is on 'reu

Re: [rspec-users] how do I mock the Rails Logger with should_receive?

2008-06-24 Thread Mikel Lindsaar
On Fri, Jun 13, 2008 at 8:56 AM, john <[EMAIL PROTECTED]> wrote: > I'm trying to mock the Rails Logger for the following code: > rescue TimeoutError => error > $logger.error("#{self.name} Timeout for #{path}: #{error}") and return > rescue SocketError => error > $logger.error("#

[rspec-users] Reusing story snippets

2008-06-14 Thread Mikel Lindsaar
I find myself doing this: Scenario "logged in user visiting the home page" do Given "A logged in user" do a_logged_in_user end When "..." Then "..." end The a_logged_in_user method is a helper method in helper.rb which sets up the state so that the user can browse the website. Later

Re: [rspec-users] Why has the --color gone from my life?

2008-06-09 Thread Mikel Lindsaar
This was fixed up updating to trunk: 3b76fda..befd422 master -> origin/master I now get colour, thanks all! Mikel On Sat, Jun 7, 2008 at 2:09 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Jun 6, 2008, at 10:57 AM, Juanma Cervera wrote: > > This was an error, but I thought it was cor

Re: [rspec-users] xhr :post giving wrong number of arguments on rails 2.1?

2008-06-05 Thread Mikel Lindsaar
On Fri, Jun 6, 2008 at 1:39 AM, Zach Dennis <[EMAIL PROTECTED]> wrote: > Use xml_http_request in your stories rather than xhr. I believe the "xhr" > method is aliased to the wrong method... I haven't looked to see if this is > a Rails issue or a rspec-rails issue, > Thanks, that worked. Mikel __

[rspec-users] xhr :post giving wrong number of arguments on rails 2.1?

2008-06-04 Thread Mikel Lindsaar
Getting a strange error. In a story I have the following step: When "I submit a search name" do xhr :post, '/searches', {:search => {:given_name => "bob", :family_name => "smith"}} end I am getting: ArgumentError: wrong number of arguments (4 for 3) stories/searching_story_spec.rb:45 in "I sub

[rspec-users] Why has the --color gone from my life?

2008-06-04 Thread Mikel Lindsaar
Hi all, Running on OSX 10.5.3, Latest Rspec trunk, Rspec rails trunk, latest autotest gem and rails 2.1 I've lost my colour output in autotest. rake spec gives colour output, but autotest gives me black and white. It was working a little bit before, I think I upgraded to the latest versions of e

[rspec-users] Getting to the session from Stories

2008-04-05 Thread Mikel Lindsaar
Hey all, In a story I want to say Given "A logged in user" do sesson[:logged_in] = true etc... end But the session method doesn't have anything to bind to, I get the error '... while evaluating nil.session...' Any ideas? The fact that the user is logged in or not, doesn't matter to this st

[rspec-users] Corrupt rspec_on_rails tar file?

2008-03-16 Thread Mikel Lindsaar
I just downloaded rspec_on_rails-1.1.3.tgz onto a mac on OSX 10.4 and another computer (Ubuntu 7.10) and I get the same tar errors when I try to decompress: rspec_on_rails-1.1.3/spec_resources/views/view_spec/implicit_helper.rhtml rspec_on_rails-1.1.3/spec_resources/views/view_spec/multiple_helper

[rspec-users] What is SpecServer?

2008-03-12 Thread Mikel Lindsaar
I have looked through the docs, looked at the code, even gave a cursory (2 page) glance at google, and it is not clear to me what SpecServer is or what it is for. Is it meant to speed up the execution of specs in a rails environment by doing some magic on the database? Or I am thinking it keeps a

Re: [rspec-users] Spec'ing Rails request.env params

2008-02-14 Thread Mikel Lindsaar
On Fri, Feb 15, 2008 at 2:52 PM, Pat Maddox <[EMAIL PROTECTED]> wrote: > On Thu, Feb 14, 2008 at 6:45 PM, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > > I have an internal system that has a rails controller action that > > needs to behave differently based

[rspec-users] Spec'ing Rails request.env params

2008-02-14 Thread Mikel Lindsaar
I have an internal system that has a rails controller action that needs to behave differently based on browser type reported by request.env['HTTP_USER_AGENT'] But I can't find a way to stub! mock or set this setting from within a spec. Looked through Test::Unit and can't find a straight forward w

[rspec-users] autotest hanging

2008-01-20 Thread Mikel Lindsaar
Heya guys & gals, I have to do some development on a Windows box, hitting a stupid problem, wondering if anyone on the list knows how to solve it. I had RSpec 1.1.1 and ZenTest 3.6.1 - this was working fine with autotest (though no colour output). I updated to rspec 1.1.2 and zentest 3.8.0 and n

[rspec-users] Alternate file jump in Textmate

2007-12-11 Thread Mikel Lindsaar
Hello all, Using RSpec 1.1 RC from the SVN source. Running in Textmate with the bundle, all working good. Got a problem with the Alternate File jump (Ctl Shift DownArrow) because it works fine in Rails with the html.erb templates, but I can not figure out how to get it working with HAML template

Re: [rspec-users] Specing raising error, handling, and then not raising error

2007-11-04 Thread Mikel Lindsaar
On 11/5/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > Mikel, > > It looks like you are doing too much here. You are specifying sending > with the SMTP object in the same block you are specifying the > algorithm for counting the sent emails. Also, the way it interrogates > the email object to extr

[rspec-users] Specing raising error, handling, and then not raising error

2007-11-04 Thread Mikel Lindsaar
Hey guys and gals, I have a snippet of code: Net::SMTP(@host, @port, @from_domain) do |smtp| @emails.each do |email| begin smtp.send_message email.encoded, email.from, email.destinations @emails_sent += 1 rescue Exception => e # blah end end end What I want to d

Re: [rspec-users] stubbing a method that yeilds sequential results

2007-10-15 Thread Mikel Lindsaar
Nice :) On 10/14/07, rupert <[EMAIL PROTECTED]> wrote: > > On 14 Oct 2007, at 08:28, Mikel Lindsaar wrote: > > > On 8/13/07, rupert <[EMAIL PROTECTED]> wrote: > >> On 12 Aug 2007, at 14:38, David Chelimsky wrote: > >>>> However, what

Re: [rspec-users] stubbing a method that yeilds sequential results

2007-10-14 Thread Mikel Lindsaar
On 8/13/07, rupert <[EMAIL PROTECTED]> wrote: > On 12 Aug 2007, at 14:38, David Chelimsky wrote: > >> However, what I actually need to do is check each result that is > >> yielded by the Connector.each_result method and compare it to the > >> previous one. If they are sufficiently similar I need t

Re: [rspec-users] Specing exit codes

2007-10-06 Thread Mikel Lindsaar
fined explicitly... Regards Mikel On 10/7/07, Scott Taylor <[EMAIL PROTECTED]> wrote: > > On Oct 6, 2007, at 11:31 PM, Mikel Lindsaar wrote: > > > I am writing a small ruby script that will be accepting input from > > postfix's pipe command (ie, not running via

[rspec-users] Specing exit codes

2007-10-06 Thread Mikel Lindsaar
I am writing a small ruby script that will be accepting input from postfix's pipe command (ie, not running via the shell, directly executing). One of the things I need to do it spec the exit codes to make sure I am returing the correct exit codes for each condition as Postfix will then return SMTP

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread Mikel Lindsaar
re doing integration > testing as well. Automated integration testing, that is - ultimately, > running the app in production IS integration testing - but we'd prefer > to avoid catching the things we missed in that particular framework. > > > Having said all of the above, I am

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread Mikel Lindsaar
rella of integration testing? Having said all of the above, I am finding Rails RSpec has totally changed the way I think about coding and designing code... it is wonderful... Regards Mikel On 7/30/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/30/07, Mikel Lindsaar <[EMAIL

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread Mikel Lindsaar
te: > On 7/30/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > > Dear Nathan, > > Starting with views and working "backwards" from a Test::Unit point of > > view has definately opened up a lot of RSpec doors for me. > > I've definitely seen advice to star

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread Mikel Lindsaar
ond to alive?" end Now... that would be cool Regards Mikel On 7/30/07, Daniel N <[EMAIL PROTECTED]> wrote: > > > On 7/30/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > > Dear Nathan, > > > > What you are sayiing is correct, and in terms of

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread Mikel Lindsaar
Dear Nathan, What you are sayiing is correct, and in terms of Ruby on Rails, BDD _IS_ View Driven development... or at least it should be IMHO. At the end of the day, the only thing that matters in a Rails App is the Behaviour shown to the user, who has as their only interface, the View. The use

Re: [rspec-users] autotest loosing RAILS_ROOT Constant?

2007-07-25 Thread Mikel Lindsaar
Don't fear... chalk this up to an error casued between the screen and keyboard... The specs that were causing this problem had a missing spec_helper.rb line. duh! Regards Mikel On 7/26/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > I am having a weird error that I have not had

[rspec-users] autotest loosing RAILS_ROOT Constant?

2007-07-25 Thread Mikel Lindsaar
I am having a weird error that I have not had before... I'm bouncing it off the list to see if anyone else has had it, or to give me some pointers about how to find it. Basically, AUTOTEST will run (RSpec mode), fine, then suddenly, will complain that RAILS_ROOT is undefined. Then I stop and rest

Re: [rspec-users] Mock or Stub strategy for validates_uniqueness_of

2007-07-24 Thread Mikel Lindsaar
Kyle, That is a good point. We are after the behaviour, not the implementation. Regards Mikel On 7/25/07, Daniel N <[EMAIL PROTECTED]> wrote: > > > > On 7/25/07, Kyle Hargraves <[EMAIL PROTECTED]> wrote: > > Daniel N wrote: > > > On 7/25/07, M

Re: [rspec-users] Mock or Stub strategy for validates_uniqueness_of

2007-07-24 Thread Mikel Lindsaar
There would be a different way. In the idea of "Only test the code you write" all you really need to spec is that you have set the right association, because activerecord has it's own tests to ensure the uniq call works. You can do this with a call to reflect_on_association. Unfortunately that c

Re: [rspec-users] Mocking Resolv::DNS?

2007-07-24 Thread Mikel Lindsaar
Thank you, works perfectly! Regards Mikel On 7/24/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > On 7/24/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > > Hello Rspecers, > > > > I have a rails project where I am calling Resolv::DNS.open and then > >

[rspec-users] Mocking Resolv::DNS?

2007-07-24 Thread Mikel Lindsaar
Hello Rspecers, I have a rails project where I am calling Resolv::DNS.open and then using the block to check a domain name. The code snippet in question is: domain = "mytest.com" Resolv::DNS.open do |dns| @mx = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) end I obviousl

[rspec-users] Little tool to help RSpec Textmate Users

2007-07-19 Thread Mikel Lindsaar
Thought someone else might like this. Just a simple way to modify your TODO list to show all unimplemented specs in your project. Insanely simple, but all good things usually are :) http://www.blognow.com.au/q/67397/Behaviour_Driven_Design_RSpec_and_Textmate039s_TODO_List.html Not sure how that

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
it pretends > to exist by sporting an ID, but is never saved to the DB). > > Make sense? > > So, if you want to mock this, you have to mock a bit more than what > you have in mind. Check out this pastie: > http://pastie.textmate.org/80159 > > David > > On 7/19/07, Mi

Re: [rspec-users] need help getting a word right

2007-07-18 Thread Mikel Lindsaar
I like the it "should..." do end calls, specifiy as well makes sense. So what is the problem? I think we should take a look at what comments are for. Essentially the "should blah" text acts as a comment on the spec. One that is then picked up by RSpec and inserted to make our specifications mor

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
Using 1.2.3 and RSpec with the RSpec Rails plugin installed from CURRENT on the RSpec SVN server. On 7/19/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > Crap, I totally, forgot to mention, sorry David. I am using betternestedset > > http://wiki.rubyonrails.org/rails/pages/

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
at version of rails are you using? And is there a plugin you're > using for nested set? > > David > > On 7/19/07, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > > Here are the migrations: > > > > class CreateNodes < ActiveRecord::Migration > > def

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
_many, so I haven't bothered to put all the tables in here and have removed the appropriate foreign keys from the nodes table. Regards Mikel On 7/19/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > Would you mind posting the migrations? > > On 7/18/07, Mikel Lindsaar <

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
include the fixture :languages, then replace out @language = mock_model... with @language = languages(:one) it all works dandy. But I'm trying to ween myself off fixtures :) Regards Mikel On 7/19/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/18/07, Mikel Lindsa

[rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread Mikel Lindsaar
Hello list, I think I have a rails related RSpec problem with a mock going out of scope on a recursive call to a model. The code is at: http://pastie.textmate.org/79821 if you want to see it highlighted. I have pasted it below as well. Basically, I have an acts_as_nested_set model called "Node"