[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

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 with it. Take a look at http

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 aam...@loveruby.net| do address = Mail::Address.new('Minero Aoki aam...@loveruby.net')

[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

[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

[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

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 directly. The second spec does not exist. You

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 exception as expected... so load

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 hand goes up 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

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 cycle

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

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 hunting

[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 already

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 contains the FIT table with the failing

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 has 20 rows of

[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,

[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: form ... button type=submit Text... / Image here /button /form Calling clicks on this doesn't find it as webrat

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 exception:

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 how

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

2008-09-29 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 ___

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: SNIP 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] 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 through

[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
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 ensure

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

2008-07-04 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. In your

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 out into

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] (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.org

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, I'm

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 let's you

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 That post is fantastic. Thanks! Couldn't

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

2008-06-25 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(#{self.name}

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

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 mostly

[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 in the

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

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] 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

[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 submit a

[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

[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-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

[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

[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

[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

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 extract

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 to merge

Re: [rspec-users] Specing exit codes

2007-10-07 Thread Mikel Lindsaar
/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 the shell, directly executing). One of the things I need to do it spec the exit

[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

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

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

2007-07-30 Thread Mikel Lindsaar
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 Ruby on Rails, BDD _IS_ View Driven development... or at least it should be IMHO. At the end of the day

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

2007-07-30 Thread Mikel Lindsaar
, really, from one point in the view, you might have four or five vertical slices described on the way down... and that would tend to integrate itself somewhat through the process. Food for thought :) Regards Mikel On 7/30/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/30/07, Mikel Lindsaar

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

2007-07-18 Thread Mikel Lindsaar
/19/07, Mikel Lindsaar [EMAIL PROTECTED] wrote: Here are the migrations: class CreateNodes ActiveRecord::Migration def self.up create_table (nodes, :options = 'ENGINE=InnoDB DEFAULT CHARSET=utf8', :force = true) do |t| t.column title,:string t.column