Re: [rspec-users] should and != operator

2009-10-12 Thread s.ross
It's not a bug. Consider: "abc".should eql("abc") <= pass "abc".should_not eql("def") <= pass But eql() is a Ruby method. In Pickaxe, you'll see that other comparators such as != >= etc. Are not implemented as overridable methods. Hope this clarifies. Hunted and pecked from my iPhone On

Re: [rspec-users] should and != operator

2009-10-12 Thread s.ross
Afaik, != is one of the few operators that is intrinsic. I believe there is no !=() method defined in Ruby. Hunted and pecked from my iPhone On Oct 12, 2009, at 12:21 PM, Willy Mene wrote: Yes, I do know about .should_not, and the example should be written that way. So the following []

Re: [rspec-users] How To Drive Out AJAX Functionality in a Rails View

2009-05-13 Thread s.ross
Hi-- On May 13, 2009, at 12:47 AM, Lee wrote: I found a potential solution from this blog: http://www.rubytutorials.net/2008/02/29/small-rspec-revelations-rjs/ In my spec for the view in which I want to include the AJAX functionality ("new.html.erb_spec.erb"), I have added a couple of Examples

Re: [rspec-users] [rspec] How to Spec a Web Services Client

2009-04-12 Thread s.ross
Thanks. I think instead of a server, I'll need to dive into replacing the results of XmlRpc::Client#call unless there's some ultra-cool way I haven't thought of. Steve On Apr 12, 2009, at 1:03 PM, Stephen Eley wrote: On Sun, Apr 12, 2009 at 3:24 PM, s.ross wrote: I put

[rspec-users] How to Spec a Web Services Client

2009-04-12 Thread s.ross
I put a pastie out at http://pastie.org/24, which is an implementation (short) of an XML-RPC client. I'm getting wrapped around an axle trying to figure out how to spec this without actually hitting the remote server. Is the best way to do this stubbing out the xml-rpc :call method to

[rspec-users] [Cucumber] Rails Upgrade Notes

2009-03-21 Thread s.ross
In the history.txt for 0.2 is an "important note" toward the bottom of the announcement. (http://github.com/aslakhellesoy/cucumber/blob/d0555e4ca8a133f020efefd5a755da04bde3f57d/History.txt ). This is really, *really* important for Rails users, but it can be more than a bit difficult to Google

Re: [rspec-users] [Cucumber, rspec-rails] uninitialized constant ActionController::UrlEncodedPairParser

2009-02-16 Thread s.ross
Applying this patch to webrat: http://webrat.lighthouseapp.com/attachments/87914/lh_161.diff did the trick for 2.2.2 and 2.3. Eek! :) On Feb 16, 2009, at 2:57 PM, Josh Knowles wrote: On Mon, Feb 16, 2009 at 5:28 PM, David Chelimsky wrote: The latest gems from github work with rails 2.3:

[rspec-users] [Cucumber, rspec-rails] uninitialized constant ActionController::UrlEncodedPairParser

2009-02-16 Thread s.ross
It seems there's a known anomaly between rspec-rails and Rails 2.3. That causes the error "uninitialized constant ActionController::UrlEncodedPairParser". I know there is a fix in somebody's repo, but what's the best way to get a working gem version of webrat/cucumber/rspec/rspec-rails that

Re: [rspec-users] [Cucumber] ssl requirement

2009-02-14 Thread s.ross
I have a fix to SslRequirement that allows you to exclude user- specified domain names. It's quite likely that you won't want to use SSL on some machines when in development. In any case, I have a bear of a time with the Rails Test::Unit setup so that part's missing, but look over: http://

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

2009-02-07 Thread s.ross
Hi-- On Feb 7, 2009, at 7:59 AM, Nick Hoffman wrote: On 06/02/2009, at 10:00 PM, s.ross wrote: I did stop writing new controller specs, but we were discussing the use-case for controller specs in the new Cukified world. Supposing you write scenarios that pretty much describe your app, what

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

2009-02-06 Thread s.ross
On Feb 6, 2009, at 10:21 AM, Scott Taylor wrote: On Feb 6, 2009, at 12:50 PM, Stephen Eley wrote: On Fri, Feb 6, 2009 at 12:17 PM, Fernando Perez 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

Re: [rspec-users] have_tag with a block

2009-02-04 Thread s.ross
Hi-- On Feb 3, 2009, at 9:44 PM, MarkMT wrote: Thanks David. Those specs are very instructive. I have no idea what I was doing wrong before, but the behavior I'm seeing now is indeed consistent with the specs and matches what I had understood from the code I'd looked at (I suspect it'll stop wo

[rspec-users] [Cucumber] How Do You Use Cucumber?

2009-02-03 Thread s.ross
I'm using Cucumber on my current project and it's causing me to wonder what other people's experience has been. I've read discussions about speeding up Cucumber and a basically everything else I can. Also, the rSpec book is articulate on the subject. What I'm curious about is whether a surv

Re: [rspec-users] [ANN, Cucumber] Textile Formatter

2009-01-27 Thread s.ross
Ok, I created stories http://github.com/sxross/cucumber_textile_formatter/tree/master :) On Jan 27, 2009, at 12:09 PM, aslak hellesoy wrote: On Tue, Jan 27, 2009 at 8:14 PM, s.ross wrote: Sheepishly, I am announcing that I created a textile formatter for Cuke. It was unabashedly ripped

[rspec-users] [ANN, Cucumber] Textile Formatter

2009-01-27 Thread s.ross
Sheepishly, I am announcing that I created a textile formatter for Cuke. It was unabashedly ripped out of the HTML formatter, so there is almost certainly a better way to do it. The incentive behind this was my desire to get stories posted on Github. Like, real fast. If only Github let me p

Re: [rspec-users] [Cucumber] Directory Layout

2009-01-22 Thread s.ross
On Jan 22, 2009, at 3:38 PM, David Chelimsky wrote: On Thu, Jan 22, 2009 at 4:51 PM, s.ross wrote: I had a relatively flat layout and wanted to group like features together so I made it more hierarchical: features/ messaging/ main_screen.feature message_page.feature steps

[rspec-users] [Cucumber] Directory Layout

2009-01-22 Thread s.ross
I had a relatively flat layout and wanted to group like features together so I made it more hierarchical: features/ messaging/ main_screen.feature message_page.feature steps/ main_screen.rb messaging_steps.rb This may be just my boneheadedness, but when I do: cucumbe

Re: [rspec-users] OT: Who To Ask About Screw.Unit?

2009-01-15 Thread s.ross
On Jan 15, 2009, at 7:24 AM, Mike Gaffney wrote: s.ross's email about Screw.Unit brought prompted me to ask this question: 1) What do you use for Javascript Unit testing? I've tried jsspec and Screw.Unit and so far I'm thinking Screw.Unit is better suited to what I'm doing. It has nested

[rspec-users] OT: Who To Ask About Screw.Unit?

2009-01-14 Thread s.ross
I've been using Screw.Unit for some js testing and like the similarity to rSpec, but information is pretty scarce on the Web. What I'm trying to sort out is how to spec a jQuery click handler that submits a form (basically emulates Rails' link_to ... :method => :post). Any pointers to MLs,

Re: [rspec-users] Testing lib code

2008-12-30 Thread s.ross
On Dec 30, 2008, at 11:02 AM, Peter Jaros wrote: On Tue, Dec 30, 2008 at 12:50 PM, s.ross wrote: This question has, I'm sure, been asked and answered hundreds of times, but I was unable to turn up anything in Google. Here's the issue: I have some code in a Rails app in the lib/

[rspec-users] Testing lib code

2008-12-30 Thread s.ross
Hello-- This question has, I'm sure, been asked and answered hundreds of times, but I was unable to turn up anything in Google. Here's the issue: I have some code in a Rails app in the lib/ directory that affects how views are rendered. Specifically, it checks CSS and Javascript files for

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
that doesnt work, then maybe try messing with that file above and see what's going wrong. M On Tue, Dec 23, 2008 at 2:13 PM, MaurĂ­cio Linhares wrote: On Tue, Dec 23, 2008 at 7:04 PM, s.ross wrote: Hello-- A bit stranger than that, I'm afraid. A fresh Rails project works wi

Re: [rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
one, recently upgraded to 2.2.2, has the problem with dependencies.rb. The main difference is that the fresh project is using gem rails and the real one vendor rails. I was hoping this would be one of those d'oh! kind of problems that everyone knew the answer to :) -s On Tue, Dec 23, 2008 a

[rspec-users] Cucumber: dependencies.rb:266:in `load_missing_constant': uninitialized constant Dispatcher

2008-12-23 Thread s.ross
I'm running into a problem getting any results from Cucumber at this point. I was able to a while ago, but I upgraded to Rails 2.2.2 and poof! No Cucumber. Any thoughts what might be wrong? Rails 2.2.2 Cucumber 0.1.13 Webrat aslakhellesoy-webrat (0.3.2.1) rspec (1.1.11) rspec-rails (1.1.11)

Re: [rspec-users] rspecing rjs - form.reset('form')

2008-12-11 Thread s.ross
x27;).reset(\"tag_form\")/, got "Element.update(\"tag_list\", \"\");\nElement.toggle(\"add_tag\"); \nElement.toggle(\"new_tag\");\nForm.reset(\"tag_form\");" Also tried: response.should have_text(/Form.reset(\"tag_form\")/) That also

Re: [rspec-users] rspecing rjs - form.reset('form')

2008-12-11 Thread s.ross
On Dec 10, 2008, at 10:27 AM, Andrei Erdoss wrote: Hello, I couldn't find much info on this. How do you rspec this: page.form.reset("form") I looked in the have_rjs source code and I can't find anything on form reset. Thanks, -- Andrei I tend not to use rjs much, but what I suspect you

Re: [rspec-users] Q: object.id is deprecated. How to mock?

2008-11-25 Thread s.ross
On Nov 25, 2008, at 12:34 PM, Peter Jaros wrote: On Tue, Nov 25, 2008 at 2:04 PM, s.ross <[EMAIL PROTECTED]> wrote: In Rails, the primary key, by default 'id', is used all over the place. However, Ruby now deprecates the use of constructs like: @post = Post.find(:first) @po

[rspec-users] Q: object.id is deprecated. How to mock?

2008-11-25 Thread s.ross
In Rails, the primary key, by default 'id', is used all over the place. However, Ruby now deprecates the use of constructs like: @post = Post.find(:first) @post_id = @post.id I buy the rationale, as the Object#id is something of a reserved method. However, changing all references to use [:id], wh

Re: [rspec-users] How To Express Change of Associated Data

2008-07-06 Thread s.ross
On Jul 6, 2008, at 3:00 PM, Pat Maddox wrote: On Sun, Jul 6, 2008 at 5:43 PM, s.ross <[EMAIL PROTECTED]> wrote: Hello-- I'm not sure if I'm pushing too far out of specing a given model, but here's what I want to express: class A < AR::Base has_many :bs def okay(s

[rspec-users] How To Express Change of Associated Data

2008-07-06 Thread s.ross
Hello-- I'm not sure if I'm pushing too far out of specing a given model, but here's what I want to express: class A < AR::Base has_many :bs def okay(segment) end end class B < AR::Base belongs_to :a end it A, "should increase the vote count for a given segment if okayed" do @a =

Re: [rspec-users] Mocking MiddleMan

2008-06-24 Thread s.ross
On Jun 23, 2008, at 6:54 PM, Pat Maddox wrote: From what I remember, the problem is that backgroundrb starts some stuff as soon as you reference MiddleMan. So even though you're stubbing the call to actually perform work, there's some other stuff that goes on behind the scenes before you're ev

[rspec-users] Mocking MiddleMan

2008-06-23 Thread s.ross
I'm trying to verify (using expectations) that a backgroundrb job is being started. I ran across this thread: http://rubyforge.org/pipermail/rspec-users/2007-October/004115.html , in which Pat Maddox conditionally loads backgroundrb. However, I don't see why the original construct that started

Re: [rspec-users] Date comparisons

2008-05-05 Thread s.ross
e something as being within some "close" tolerance. -s On 5. mai. 2008, at 05.42, "s.ross" <[EMAIL PROTECTED]> wrote: Hi-- On May 3, 2008, at 9:17 AM, Joe Van Dyk wrote: I occasionally get this error: 1) 'A puzzle once featured, should no longer be nominat

Re: [rspec-users] Date comparisons

2008-05-04 Thread s.ross
Hi-- On May 3, 2008, at 9:17 AM, Joe Van Dyk wrote: I occasionally get this error: 1) 'A puzzle once featured, should no longer be nominated' FAILED expected: Sun May 04 09:10:26 -0700 2008, got: Sun May 04 09:10:26 -0700 2008 (using ==) ./spec/models/puzzle_spec.rb:180: So, the dates l

Re: [rspec-users] laziness plugin

2008-04-04 Thread s.ross
On Apr 4, 2008, at 8:45 PM, Will Sargent wrote: > Just for general entertainment, apparently you can get Rails to write > your unit tests now: > > "Laziness isn't just helpful in development mode, though - it also > comes into play in production. If you've installed the > exception_notification pl

Re: [rspec-users] ActiveRecord, spec'ing find has right :order parameter

2008-03-05 Thread s.ross
On Mar 5, 2008, at 9:43 AM, Rick DeNatale wrote: > And by the way, here's my sketch of how to do this, just looking not > to reinvent the wheel: Are you aware that Rails extends Hash with a few extra methods: mymac:~/rails/myproj $ script/console Loading development environment (Rails 2.0.2) >>

Re: [rspec-users] Pretty story output for non-Rails project

2008-03-04 Thread s.ross
On Mar 4, 2008, at 9:26 AM, aslak hellesoy wrote: > I forgot - this is an old bug - not working with rails, only "vanilla" > http://rspec.lighthouseapp.com/projects/5645/tickets/113-13547-story-runner-html-formatted-output Ok, I feel a little less dense now :)

Re: [rspec-users] Pretty story output for non-Rails project

2008-03-04 Thread s.ross
On Mar 4, 2008, at 5:24 AM, aslak hellesoy wrote: > This is in the latest release. Just pass --format html on the ocmmand > line. ARGS is read by one of the internal files in RSpec - not all.rb. > Try --help too. > > Aslak I must be dense: RSpec-1.1.3 (build 20080131122909) - BDD for Ruby ruby

Re: [rspec-users] Pretty story output for non-Rails project

2008-03-03 Thread s.ross
On Mar 3, 2008, at 10:19 PM, David Chelimsky wrote: > In the mean time, you > can do it on the command line with --format html and open the > resulting file in a browser. Er... stories? How do you format story output as html? ___ rspec-users mailing lis

Re: [rspec-users] How to dump contents produced during spec evaluation?

2008-02-24 Thread s.ross
On Feb 24, 2008, at 4:29 PM, Alex Satrapa wrote: > Okay, this is weird. The result seems to indicate that the body of > the response is the literal text, "resource/new": > > My autotest results show (I've changed the name of the resource to > 'resource'): >> Try puts response.class puts respons

[rspec-users] should send_email always succeeds?

2007-12-29 Thread s.ross
I wrote the following in my spec: emails = ActionMailer::Base.deliveries emails.length.should eql(2) response.should send_email { with_tag('tr', @contact_info[:full_name]) } knowing that 1) an email is being sent; and 2) the contact info is in a 'p' tag and only in a

Re: [rspec-users] Converting to Rails 2.0.2

2007-12-28 Thread s.ross
aves wrote: > The REV constants no longer exist in trunk (and haven't for a while), > yet somehow your rspec_on_rails in vendor is still expecting it. > Meaning you don't actually have a copy of trunk in > plugins/rspec_on_rails, I guess. > > HTH > > Kyle > > On

[rspec-users] Converting to Rails 2.0.2

2007-12-28 Thread s.ross
I'm moving an older project to Rails 2.0.2 and ran into a roadblock on the version matching. Here's script/console session: >> Spec::VERSION::REV => "1785" >> Spec::Rails::VERSION::REV NoMethodError: undefined method `run=' for Test::Unit:Module from /Users/sxross/rails/tastie_work/ven

Re: [rspec-users] Expectations on Class Methods

2007-11-27 Thread s.ross
On Nov 27, 2007, at 12:23 PM, Scott Taylor wrote: > Or, you could also do some sort of behaviour verification. What do > you expect this DatabaseMapper setup should do? Why is it in your > code? If you can answer these questions, then you can probably write > a test for it (but without stubbing

[rspec-users] Expectations on Class Methods

2007-11-27 Thread s.ross
Sorry about the non-specific subject. Here's what I'm trying to do. I have a method: DataMapper::Database.setup That I want to create an expectation on. I wrote: DataMapper::Database.should_receive(:setup).once.and_return (connection_hash) The call to setup is invoked in the "Object" namespa

Re: [rspec-users] Not sure why this is failing

2007-11-17 Thread s.ross
Try with(nil) I think params[:user] will return nil. On Nov 17, 2007, at 8:18 PM, __iso __ wrote: >>> Address.should_receive(:new).with(no_args).and_return @address > > That doesn't seem to work either. I had also tried with :any and that > failed as well. > > It does seem to work when removin

Re: [rspec-users] Who's using --format rdoc

2007-11-11 Thread s.ross
does this mean that: rake spec:doc will not produce plain text specdocs? On Nov 11, 2007, at 3:39 PM, aslak hellesoy wrote: > I'm doing some housekeeping and just realised that the rdoc formatter > produces gibberish: > http://rspec.rubyforge.org/rdoc/files/EXAMPLES_rd.html > > Will anyone pro

Re: [rspec-users] Keeping Up with Trunk

2007-11-06 Thread s.ross
I've been having good luck with this up to now, but then got a mismatch today. It seems the svn servers on Rubyforge have been a bit spotty -- or at least that's how it seems. They have been closing connections and maybe that's how I got out of sync. Thx On Nov 6, 2007, at 3:01 PM, David Ch

Re: [rspec-users] Side Effects in Stories

2007-10-19 Thread s.ross
On Oct 19, 2007, at 12:21 PM, Jonathan Linowes wrote: > from my specs on restful_authentication's models/user_observer_spec.rb > > context "A UserObserver" do > setup do > @user = mock('user') > @user_observer = UserObserver.instance > end > > specify "should call UserNotifier.delive

Re: [rspec-users] Side Effects in Stories

2007-10-19 Thread s.ross
On Oct 18, 2007, at 6:09 AM, Daniel N wrote: On 9/11/07, s.ross <[EMAIL PROTECTED]> wrote: I have a story where the user resets the password [hey, this story thing really rocks!]. It is expected that the password will change and that the user will be redirected to a login screen. A side

Re: [rspec-users] RailsStory - lessons learned

2007-10-17 Thread s.ross
> The welcome controller fails when the HTTP_USER_AGENT is missing. Alvin-- Try: request.stub!(:user_agent).and_return('Mozilla') ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Top Quoting?

2007-10-15 Thread s.ross
On Oct 15, 2007, at 4:35 PM, Nathan Sutton wrote: >> This is especially true in cases where the reply might be two or >> three lines long, and the untrimmed quoted message stretches on for >> screenfuls. > > I totally agree, in fact I let most of these conversations just pass > by because it's too

[rspec-users] Top Quoting?

2007-10-15 Thread s.ross
Sort of off-topic and don't mean to complain, but many on this list use top quoting. That works ok if you don't quote the whole previous thread. However, I'm finding that scrolling forever to locate the reply on longer threads is getting tedious. What's the rationale for top-quoting? Thx.

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-17 Thread s.ross
David-- Worse, even though you sell it as a tool for dealing with legacy code > (code without tests), it will end up becoming the tool people use I think this is the part that is of the most concern. That people will substitute a tool for good judgment. That should not reflect poorly on BD

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread s.ross
--steve On Sep 16, 2007, at 12:04 PM, David Chelimsky wrote: > On 9/16/07, s.ross <[EMAIL PROTECTED]> wrote: >> While the spirit of BDD is to spec first and code second, many of us >> have legacy code. Worse, some of us have legacy code without very >> good coverage. Reco

[rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread s.ross
While the spirit of BDD is to spec first and code second, many of us have legacy code. Worse, some of us have legacy code without very good coverage. Recognizing that *I* have such code, I created a script that grinds through your .rb files and creates placeholder specs for each public meth

Re: [rspec-users] controller.expect_render has me beat!

2007-09-14 Thread s.ross
Look at your test.log and you can see exactly what was rendered. That should explain why the example is failing. This works best if you can silence the logs for all examples other than the one you are testing. On Sep 14, 2007, at 7:35 PM, sinclair bain wrote: Hi, A controller has a method

[rspec-users] Side Effects in Stories

2007-09-10 Thread s.ross
I have a story where the user resets the password [hey, this story thing really rocks!]. It is expected that the password will change and that the user will be redirected to a login screen. A side effect is that the user will receive email with his/her new password. Where I'm stuck is in asc

[rspec-users] Restatement: The Rspec Mocking Framework

2007-09-03 Thread s.ross
This is and important enough announcement that I though it wise to put in a new thread so it doesn't get buried: On Sep 3, 2007, at 8:42 AM, David Chelimsky wrote: > Hi all, > > I've talked this over w/ a couple of the other committers and we've > decided that we will NOT be deprecating the mo

Re: [rspec-users] controller spec with model that validates_uniqueness

2007-08-23 Thread s.ross
>> Does this work? >>>> >>>>Image.stub!(:validates_uniqueness_of).and_return(true) >>>> >>>> >>>> On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote: >>>>> I want to use mocks and stubs to test the cont

[rspec-users] controller spec with model that validates_uniqueness

2007-08-23 Thread s.ross
I want to use mocks and stubs to test the controller, but am having trouble getting my validation not to trigger. Here's the code: # spec: Image.stub!(:find).and_return(@image) @image.should_receive(:save!).once.with(:any_args) put :update, :id => @image.id, :category_id => @ca

Re: [rspec-users] Wording describe/it so specdocs look good

2007-07-05 Thread s.ross
On Jul 5, 2007, at 12:52 PM, David Chelimsky wrote: >> Agent "should not allow the same user to rate the same agent twice >> with the same kind of transaction" >> >> Thoughts? > > How would you phrase all this with context/specify? Or, a bit further > off target, TestCase/test_method? > I wouldn

Re: [rspec-users] Wording describe/it so specdocs look good

2007-07-05 Thread s.ross
For that simple case, yes. But how about the case where I specify: Agent "should not be possible for the same user to rate the same agent twice with same kind of transaction" The English grammar gets a bit twisty. Perhaps: Agent "should not allow the same user to rate the same agent twice wi

[rspec-users] Wording describe/it so specdocs look good

2007-07-05 Thread s.ross
I'm looking through my specs and they work great, but they don't read as English. I'm wondering how others are phrasing these. Here are some examples: describe Agent do it 'should be possible to create one' do end end This reads as "Agent should be possible to create one". Any suggest

Re: [rspec-users] [Rails] RSpec, controller testing, and routes.rb

2007-06-29 Thread s.ross
rspec-users@rubyforge.org (cross-posting) On Jun 29, 2007, at 9:20 AM, Bill Kocik wrote: I didn't see any forums or lists for RSpec users, so I'm hoping there are RSpec users on this list who may be able to help. I have this in my routes.rb: map.signup 'signup/:step', :controller => 're