Re: [rspec-users] another noob question about stubs

2008-04-29 Thread Patrick Aljord
ok thanks, I still get a "undefined method `successful?'", successful? is a method that is used inside of the block, it's partof the open_id_authentication plugin, any way to include the plugin in the spec so that it recognizes the method? thanks in advance Pat ___

Re: [rspec-users] odd fixture behavior

2008-04-29 Thread Ben Mabey
Ben Mabey wrote: Hello all, I am upgrading an older app from rails 1.2.3 to rails 2.0.2 and am upgrading rspec and rspec-on-rails to 1.1.3 in the process. After upgrading I am getting some weird errors relating to fixtures. Most of the model example groups have fixtures declared at the top.

[rspec-users] odd fixture behavior

2008-04-29 Thread Ben Mabey
Hello all, I am upgrading an older app from rails 1.2.3 to rails 2.0.2 and am upgrading rspec and rspec-on-rails to 1.1.3 in the process. After upgrading I am getting some weird errors relating to fixtures. Most of the model example groups have fixtures declared at the top. What is odd is tha

Re: [rspec-users] Sharing: dont_repeat_yourself plugin custom RSpec matcher

2008-04-29 Thread Ashley Moran
On 29 Apr 2008, at 18:25, 21croissants wrote: I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_dupl

[rspec-users] Sharing: dont_repeat_yourself plugin custom RSpec matcher

2008-04-29 Thread 21croissants
I wrote a Rails plugin which uses simian to look for duplicates lines in your code and reports in html format, Textmate or Netbeans. I wrote it using RSpec and I have included a RSpec custom matcher: it { rails_application. with_threshold_of_duplicate_lines(4). should be_DRY } If you use Autot

Re: [rspec-users] Spec'ing controller macros

2008-04-29 Thread Pat Maddox
On Tue, Apr 29, 2008 at 9:48 AM, Matt McNeil <[EMAIL PROTECTED]> wrote: > describe ApplicationController do > class FooController < ApplicationController > def index; render :text => "foo"; end > end > controller_name :foo > > it "should turn off session management for requests made by

[rspec-users] Fixture Scenarios plugin

2008-04-29 Thread Steve
Just curious if anything special needs to be done to use the Rails fixture scenarios plugin(http://code.google.com/p/fixture-scenarios/) with rspec? Would I just create the "scenarios" inside the spec/fixtures dir, as opposed to the test/fixtures dir? Thanks, Steve

[rspec-users] Spec'ing controller macros

2008-04-29 Thread Matt McNeil
Hi, (This is my first post after months of appreciative lurking...) I'm trying to spec the following conditional controller macro: class ApplicationController < ActionController::Base # turn off session management for robots session :off, :if => lambda {|req| req.user_agent =~ /(Google|Slur

Re: [rspec-users] another noob question about stubs

2008-04-29 Thread Matt Patterson
On 29 Apr 2008, at 17:00, Patrick Aljord wrote: I tried to make a stub but with no success, maybe because it's a block. Any hint about that one please? What are you trying to stub? Are you trying to stub authenticate_with_open_id? def open_id_authentication(openid_url) authenticate_with_o

[rspec-users] another noob question about stubs

2008-04-29 Thread Patrick Aljord
I have this function in my controller: def open_id_authentication(openid_url) authenticate_with_open_id(openid_url, :required => [:nickname, :email], :optional => [:fullname]) do |result, identity_url, registration| if result.successful? @user = User.find_or_initialize_by_identi

Re: [rspec-users] noob question for getting true or false from a function

2008-04-29 Thread Patrick Aljord
ok thanks a lot. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] mock expectation in before block

2008-04-29 Thread Andrea Fazzi
Matt Berther ha scritto: Hi Andrea, I generally put stub! calls in the before block and then have the mock expectation in the example block. -- Matt Berther http://www.mattberther.com On Apr 29, 2008, at 5:59 AM, Andrea Fazzi wrote: Hi all, consider a class Foo that send, in its constr

Re: [rspec-users] mock expectation in before block

2008-04-29 Thread Matt Berther
Hi Andrea, I generally put stub! calls in the before block and then have the mock expectation in the example block. -- Matt Berther http://www.mattberther.com On Apr 29, 2008, at 5:59 AM, Andrea Fazzi wrote: Hi all, consider a class Foo that send, in its constructor, some message to

Re: [rspec-users] story runner on restful_authentication question

2008-04-29 Thread steven shingler
ooh - good spot! thanks :) On Tue, Apr 29, 2008 at 12:36 PM, Rick DeNatale <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 6:51 AM, steven shingler <[EMAIL PROTECTED]> wrote: > > Thank you for all the replies. > > I'm unable to use ruby-debug, cos am running on JRuby, > > I haven't yet us

[rspec-users] mock expectation in before block

2008-04-29 Thread Andrea Fazzi
Hi all, consider a class Foo that send, in its constructor, some message to an object of class Bar: class Foo def initialize(bar) @bar = bar @bar.some_message end ... end Now, in order to test Foo, I'd like to decouple it from Bar mocking bar object, so: describe Foo do before

Re: [rspec-users] story runner on restful_authentication question

2008-04-29 Thread Rick DeNatale
On Tue, Apr 29, 2008 at 6:51 AM, steven shingler <[EMAIL PROTECTED]> wrote: > Thank you for all the replies. > I'm unable to use ruby-debug, cos am running on JRuby, I haven't yet used JRuby, but there seems to be a JRuby wrapper for rdebug http://wiki.jruby.org/wiki/Using_the_JRuby_Debugger --

Re: [rspec-users] story runner on restful_authentication question

2008-04-29 Thread steven shingler
Thank you for all the replies. I'm unable to use ruby-debug, cos am running on JRuby, but a liberal sprinkling of logger.debug in the controllers helped me sort out what was going on the test.log. Thanks for that tip. It made me want for a way of writing something to the log from within the rspec

Re: [rspec-users] story runner on restful_authentication question

2008-04-29 Thread Bart Zonneveld
On 29-apr-2008, at 12:46, Rick DeNatale wrote: On Mon, Apr 28, 2008 at 4:16 PM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: On 28 apr 2008, at 17:31, steven shingler wrote: When "the user logs in with username and password" do post "/sessions/create", :user => { :login => @username, :pa

Re: [rspec-users] story runner on restful_authentication question

2008-04-29 Thread Rick DeNatale
On Mon, Apr 28, 2008 at 4:16 PM, Bart Zonneveld <[EMAIL PROTECTED]> wrote: > > On 28 apr 2008, at 17:31, steven shingler wrote: > > > > > When "the user logs in with username and password" do > > post "/sessions/create", :user => { :login => @username, :password > > => @password } > > end > >

Re: [rspec-users] noob question for getting true or false from a function

2008-04-29 Thread Helder Ribeiro
On Tue, Apr 29, 2008 at 3:06 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > On Apr 29, 2008, at 12:59 AM, Patrick Aljord wrote: > > > > Hey all, > > > > I have an action that looks like this: > > > > def create > > if using_open_id? > > open_id_authentication(params[:openid_url]) > > els

Re: [rspec-users] ANN: RSpactor 0.9.10 (aka. beta)

2008-04-29 Thread rubyphunk
If you have setup the binary as described in INSTALL.txt you can even run rspactor from command line. 'cd' in your project directory and run 'rspactor'.. - andreas On 29 Apr., 05:03, "Zach Dennis" <[EMAIL PROTECTED]> wrote: > Just put a directory path to a project in the text field, and click Ru