Re: [rspec-users] undefined method `route_for

2009-11-11 Thread David Chelimsky
On Wed, Nov 11, 2009 at 1:42 AM, Amit Kulkarni wrote: > Thanks David for the information but still i am getting the same error. > What i have done is: > I have home controller. > now i am writing route scenarios in home_controller_spec.rb which is > under spec/controllers directory > > I tried yo

Re: [rspec-users] undefined method `route_for

2009-11-11 Thread David Chelimsky
On Nov 11, 2009, at 5:58 AM, Amit Kulkarni wrote: Hi David still no success. require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe HomeController, "routes" do describe "route generation" do it "should map { :controller => 'home', :action => 'index' } to / home" do

Re: [rspec-users] undefined method `route_for

2009-11-12 Thread David Chelimsky
On Wed, Nov 11, 2009 at 11:19 PM, Amit Kulkarni wrote: > David Chelimsky wrote: > > On Nov 11, 2009, at 5:58 AM, Amit Kulkarni wrote: > > > >> > >>it "should map { :controller => 'home' } RESTfully" do > >> params_from

Re: [rspec-users] undefined method `route_for

2009-11-12 Thread David Chelimsky
On Thu, Nov 12, 2009 at 11:32 PM, Amit Kulkarni wrote: > David Chelimsky wrote: > > On Wed, Nov 11, 2009 at 11:19 PM, Amit Kulkarni > > wrote: > > > >> >> > >> It gets executed but i am not able to see any results as in 2 examples 2 > &g

Re: [rspec-users] undefined method `route_for

2009-11-13 Thread David Chelimsky
On Fri, Nov 13, 2009 at 2:28 AM, Amit Kulkarni wrote: > MY spec helper contains following code: > # This file is copied to ~/spec when you run 'ruby script/generate > rspec' > # from the project root directory. > ENV["RAILS_ENV"] ||= 'test' > require > > File.expand_path(File.join(File.dirname(__

Re: [rspec-users] Using Mock / Datamapper / Associations

2009-11-13 Thread David Chelimsky
On Fri, Nov 13, 2009 at 10:04 AM, Arco wrote: > I'm using datamapper and have two associated classes: > - Org - has n, :users > - User - belongs_to :org > > When I test the User object, I have been able to mock/stub methods of > the Org object. Great! > > But - I still need to require 'org.rb' t

Re: [rspec-users] Stub a call that happens inside a block

2009-11-15 Thread David Chelimsky
On Sun, Nov 15, 2009 at 7:50 PM, Marcelo de Moraes Serpa < celose...@gmail.com> wrote: > Hello list, > > I had a hard time to find out a way to mock the singleton feed method of > the following class: > class RssReader > > def self.feed(feed_url) > output = [] > open(feed_url) do |http|

Re: [rspec-users] undefined method `route_for

2009-11-17 Thread David Chelimsky
On Tue, Nov 17, 2009 at 4:53 AM, Amit Kulkarni wrote: > Amit Kulkarni wrote: > > Oh that means if i am using rails version 2.1.2 or more then i need to > > have rspec version 1.1.12. > > In that case i need to remove the latest version and install rspec > > 1.1.12. > > I will do it and update you

Re: [rspec-users] MockExpectationError actual args format for stubbed messages

2009-11-18 Thread David Chelimsky
On Wed, Nov 18, 2009 at 2:53 AM, Tom Stuart wrote: > Hi, > > Is it realistic and desirable to tweak RSpec so that the > MockExpectationError for a stubbed message works as specified in the > attached spec patch? > > In short, we wasted some time today on a wild goose chase because a failing > exp

Re: [rspec-users] rspec-rails gem double quoting (My)SQL?

2009-11-18 Thread David Chelimsky
On Tue, Nov 17, 2009 at 3:04 PM, David Nawara wrote: > Hi all, > > This seems like a plugin conflict (I haven't yet had success replicating > this in a new project), but short version is: when I have "rspec-rails" > in my environment.rb plugin config, table names are double quoted in > mysql quer

Re: [rspec-users] Running simple rspec, no output

2009-11-19 Thread David Chelimsky
On Thu, Nov 19, 2009 at 4:11 AM, bqaanne wrote: > > Hi, > > I am very new to Ruby and Rspec, and found a simple tutorial online about > rspec. > > It involves two files: > bowling.rb and bowling_spec.rb > > # bowling_spec.rb > require'rubygems' > require 'spec' > require 'bowling' > > describe Bo

Re: [rspec-users] Gemspec development dependencies seems to be messed up

2009-11-19 Thread David Chelimsky
On Wed, Nov 18, 2009 at 7:05 AM, grimen wrote: > $ sudo gem install rspec-rails --development > Password: > ERROR: Error installing rspec-rails: >rspec requires cucumber (>= 0.3, development) > > > ...and when installed cucumber manually, it ends up with weird stuff. > Can you be more s

Re: [rspec-users] Gemspec development dependencies seems to be messed up

2009-11-20 Thread David Chelimsky
c's dependencies, and their dependencies, and so on, and so on, and so on ... > > > grimen > > On Nov 19, 10:50 pm, David Chelimsky wrote: > > On Wed, Nov 18, 2009 at 7:05 AM, grimen wrote: > > > $ sudo gem install rspec-rails --development > > >

Re: [rspec-users] autospec not detecting new files

2009-11-20 Thread David Chelimsky
On Fri, Nov 20, 2009 at 7:25 AM, Andy Koch wrote: > On Nov 19, 10:22 pm, Stephen Eley wrote: > > On Fri, Nov 20, 2009 at 1:02 AM, Andy Koch > wrote: > > > > > I have a project where autospec is not adding new files to it's test > > > list. > > > > Autotest (which autospec is really just a wrapp

Re: [rspec-users] spec_helper getting reloaded after specs run under Textmate/Spork

2009-11-23 Thread David Chelimsky
On Sat, Nov 21, 2009 at 12:28 AM, Elliot Winkler wrote: > I'm having the hardest time trying to figure out something weird I've > suddenly run into. So I'm using Spork to run my specs. Naturally I've got > TM_RSPEC_OPTS in Textmate set to --drb and I'm running `spork` from the > command line to fi

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

2009-11-23 Thread David Chelimsky
o this slightly differently, but got it to work with fakefs-0.2.1. Fixed in git. Cheers, David > > > On Nov 8, 3:30 pm, David Chelimsky wrote: > > On Sun, Nov 8, 2009 at 2:35 AM, Conrad Taylor > wrote: > > > David, I'm still seeing the issue. Thus, here&

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

2009-11-23 Thread David Chelimsky
On Mon, Nov 23, 2009 at 9:36 PM, Scott Taylor wrote: > > On Nov 23, 2009, at 9:35 PM, David Chelimsky wrote: > > On Fri, Nov 20, 2009 at 9:06 PM, Bogdan Dumitru wrote: > >> The syntax for use_fakefs changed in version 0.2.1 and the fixtures >> for rspec are gener

Re: [rspec-users] undefined method `route_for

2009-11-26 Thread David Chelimsky
On Thu, Nov 26, 2009 at 1:21 AM, Amit Kulkarni wrote: > Amit Kulkarni wrote: > > Ok Fine.That sounds to be a good idea. > > Thanks > > Hi David, > Good news,My routing scenarios are working now. > I dont know how but it did.I was going to mail you the app but it is > working fine now. > > Excelle

Re: [rspec-users] Display Rspec output in an html file

2009-11-27 Thread David Chelimsky
On Fri, Nov 27, 2009 at 3:21 AM, Amit Kulkarni wrote: > Amit Kulkarni wrote: > > Any suggestions on the above topic > > Hello, > I want to print my output in an html file. > I am using command rake spec:controllers --format html:result.html from > the root directory > But it is not working. > Ple

Re: [rspec-users] Depot app, Demeter's law and troubles cleanly specing

2009-11-27 Thread David Chelimsky
On Thu, Nov 26, 2009 at 9:24 PM, Emerson Macedo wrote: > Fernando Perez wrote: > > Hi, > > > > Let's take the example of the depot app. In my controller I set @order. > > Then in the view comes the bad stuff: > > > > @order.items.each do |item| > > item.product.title > > end > > > > Now I'm havi

Re: [rspec-users] surprising...

2009-11-29 Thread David Chelimsky
On Sun, Nov 29, 2009 at 12:33 AM, rogerdpack wrote: > It is somewhat surprising to me, as a newbie, to have to assert > a.should be_a(Hash) > > That extra space in there feels awkward. > > Suggestion: > > allow for constructs like > a.should.be_a(Hash) > > Thoughts? > You're about 4 years late to

Re: [rspec-users] undefined method `route_for

2009-12-07 Thread David Chelimsky
On Mon, Dec 7, 2009 at 5:32 AM, Amit Kulkarni wrote: > Hi David, > I have some query regarding running spec command. > When i tried to run normal testcase by command "spec > test_controller_spec.rb" > then that particular test case runs but the routing testcase fails. > > Now if i run through the

Re: [rspec-users] Rspec, Mocha Expectations Not Met Bug?

2009-12-08 Thread David Chelimsky
On Tue, Dec 8, 2009 at 2:17 AM, Sam Woodard wrote: > Code and tests at, > > http://gist.github.com/251480 The objects you're setting expectations on are not the same objects that are being loaded by emailed_association_requests.to_send on line 4 of the gist. They may have the same database IDs,

Re: [rspec-users] New RSpec methods to Object proposal: should_all and should_none

2009-12-09 Thread David Chelimsky
On Wed, Dec 9, 2009 at 5:41 AM, Rodrigo Rosenfeld Rosas < lboc...@yahoo.com.br> wrote: > I was thinking that it would be great to add 2 additional methods to > Object: should_all and should_none. > > The idea is that we would be able to write tests like: > > [...@admin, @allowed_user].should_all b

Re: [rspec-users] New RSpec methods to Object proposal: should_all and should_none

2009-12-09 Thread David Chelimsky
es. Once the idea has been fleshed out and in use we can merge in the one that gets community consensus - or not :) Cheers, David > Pat > On Dec 9, 2009, at 5:27 AM, David Chelimsky wrote: > > On Wed, Dec 9, 2009 at 5:41 AM, Rodrigo Rosenfeld Rosas > wrote: >> >> I was t

Re: [rspec-users] Problem with Before Filters

2009-12-10 Thread David Chelimsky
On Thu, Dec 10, 2009 at 2:32 AM, Amit Kulkarni wrote: > Hello, > I am writing controller specs.I want to know how can i write specs which > invlove before filters in controllers. Generally, before filters are part of the internal implementation and don't warrant specification that knows about the

Re: [rspec-users] Need Help with Specs failing when using ActionMailer

2009-12-10 Thread David Chelimsky
On Wed, Dec 9, 2009 at 7:48 PM, Brad wrote: > No one was able to help me with the last post so I thought I would try > again with more details.  I am having problems with specs that invoke > the mailer.  My User model has a method that invokes a mailer as part > of the create_from_signup method. >

Re: [rspec-users] Autospec is running the full suite too often

2009-12-10 Thread David Chelimsky
On Wed, Dec 9, 2009 at 5:28 PM, DEfusion wrote: > This is a problem I experience quite a bit: > > 1) Create a spec and outline all the examples (as not yet implemented) > 2) Write the body of a example > 3) Autospec runs spec -> fail > 4) Make that example pass > 5) Autospec runs spec -> pass > 6)

Re: [rspec-users] Error Running Standalone/Command Line rspec: undefined method Pathname

2009-12-12 Thread David Chelimsky
On Sat, Dec 12, 2009 at 11:28 AM, athem wrote: > Hello, > > I've written the following simple rspec test that I'm trying to run > (rspec 1.2.9) standalone (outside Rails) from the command line and > getting the following error.  Any idea for how to fix this?  Thanks. > > $>  spec foo_rspec.rb > >

Re: [rspec-users] Example vs ExampleProxy

2009-12-13 Thread David Chelimsky
On Sun, Dec 13, 2009 at 2:58 PM, Sean Grove wrote: > Hey all, > > I'm working on bring DeepTest up to compatibility with rspec 1.2.9 in order > to parallelize tests, and hit a few roadblocks after 1.1.12. Specifically, I > was wondering about ExampleProxy (which I know now is for the custom > form

Re: [rspec-users] Stub activerecord find given instance?

2009-12-14 Thread David Chelimsky
On Sat, Dec 12, 2009 at 1:35 PM, Saverio Miroddi wrote: > Tom Stuart wrote: >> On 10 Nov 2009, at 14:08, Saverio Miroddi wrote: >>> Is there a clean/simple way of stubbing the activerecord find() for a >>> single instance? >> >> MyModel.stub(:find).with(42).and_return(myModel) > > Didn't work as e

Re: [rspec-users] Problem with Before Filters

2009-12-14 Thread David Chelimsky
On Mon, Dec 14, 2009 at 1:05 AM, Amit Kulkarni wrote: > Thanks David, > Now in spec when i write login_as :admin then there must be some method > written for login_as? That would be a helper that you write yourself or is provided by the authentication framework you're using. It lives in the spec

Re: [rspec-users] Problem with Before Filters

2009-12-14 Thread David Chelimsky
On Mon, Dec 14, 2009 at 3:26 AM, Andrei Erdoss wrote: > On Mon, Dec 14, 2009 at 9:05 AM, Amit Kulkarni wrote: >> >> Thanks David, >> Now in spec when i write login_as :admin then there must be some method >> written for login_as? >> Now if there are before filters in controller then do we need to

Re: [rspec-users] "have" matcher special case for owned collection with 1 item

2009-12-14 Thread David Chelimsky
On Mon, Dec 14, 2009 at 3:57 PM, DeNigris Sean wrote: > If I'm reading the docs right, the current implementation would be:   > my_workspace.should have(1).documents > > Would it be hard to have it be:  my_workspace.should have(1).document >                                                        

Re: [rspec-users] spec with user culture

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 8:25 AM, Gnagno Gnagno wrote: > Tom Stuart wrote: > > How does the application detect the user's "culture"? > > > > Cheers, > > -Tom > > Thanks for your reply Tom, > > in my home controller I have a line like this for each language: > redirect_to localized_home_page_path :

Re: [rspec-users] class variables different between spec and runtime?

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons < peter.fitzgibb...@gmail.com> wrote: > Hello Folks, > > This gist http://gist.github.com/261791 has an example user.rb, > user_spec.rb > At runtime, this snippet fails > > u = User.find(123) > u.update_with_profile({...}) > The error occurred whi

Re: [rspec-users] class variables different between spec and runtime?

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky wrote: > > > On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons < > peter.fitzgibb...@gmail.com> wrote: > >> Hello Folks, >> >> This gist http://gist.github.com/261791 has an example user.rb, >> u

Re: [rspec-users] class variables different between spec and runtime?

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 9:30 AM, Rick DeNatale wrote: > Also counting on class variables to retain state in Rails is a recipe > for disaster. > Did you read that in rails recipes? :-/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfo

Re: [rspec-users] concept of given

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack wrote: > Forgive me if the question is a common one... > > does rspec have any concept like > > given "a certain set of paths" do > > it "should be able to recreate them" do; end > it "..."; end > end > Not built into rspec. There is a merb extension

Re: [rspec-users] concept of given

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 10:15 AM, Rick DeNatale wrote: > On Tue, Dec 22, 2009 at 10:38 AM, David Chelimsky > wrote: > > On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack > wrote: > >> > >> Forgive me if the question is a common one... > >> > >>

Re: [rspec-users] concept of given

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 10:31 AM, rogerdpack wrote: > > > context "given a certain set of paths" do > > Ahh so it's called context. > > Cool (though I'll admit that naming it "given" can make it sound more > like an English sentence, so an alias would be a suggestion). > http://gist.github.com/20

Re: [rspec-users] no should raise_exception

2009-12-22 Thread David Chelimsky
On Tue, Dec 22, 2009 at 9:33 AM, rogerdpack wrote: > > raise_error already catches any type of exception, error or not: > > > > class BlahException < Exception; end > > class BlahError < StandardError; end > > > > lambda { raise BlahException }.should raise_error(BlahException) > > lambda

Re: [rspec-users] Spec'ing Inherited Resource Controllers

2009-12-24 Thread David Chelimsky
On Thu, Dec 24, 2009 at 1:45 AM, Juanma Cervera wrote: > Hello, > > I am trying to write the specs for controllers that use > InheritedResource. > Can somebody tell me if this is possible? > I have read that I have to use integrated_views, but even in that case > it doesn't work. > I have posted a

Re: [rspec-users] What does as_null_object do?

2009-12-25 Thread David Chelimsky
On Wed, Dec 23, 2009 at 3:44 PM, Ronald Chaplin wrote: > So I'm going through the rspec book right now, and get to page 72, as it > introduces Spec::Mocks::Methods#as_null_object . In the book, it doesn't > describe how it operates, or much detail about it other than it tells to > expect certain

Re: [rspec-users] Custom matcher for predicates

2009-12-26 Thread David Chelimsky
On Sat, Dec 26, 2009 at 5:53 PM, Ed Howland wrote: > I hope this isn't a dumb question, but can a custom matcher be written > for a possibly non-existant predicate? I know that if the object > responds to some predicate? message, RSpec will breate a custom > matcher on the fly for it. Such as be_

Re: [rspec-users] Custom matcher for predicates

2009-12-26 Thread David Chelimsky
On Sat, Dec 26, 2009 at 6:55 PM, David Chelimsky wrote: > On Sat, Dec 26, 2009 at 5:53 PM, Ed Howland wrote: > >> I hope this isn't a dumb question, but can a custom matcher be written >> for a possibly non-existant predicate? I know that if the object >> respon

[rspec-users] generated gem config?

2009-12-27 Thread David Chelimsky
Hey all, The cucumber-rails generator generates config/environments/cucumber.rb for us, which means we don't need to do any gem configuration. As things stand now, rspec-rails does not do the same thing for us. I'm thinking of having the generator update config/environments/test.rb, adding gem con

Re: [rspec-users] Submitting a Custom Matcher: gem or other method?

2009-12-28 Thread David Chelimsky
On Sun, Dec 27, 2009 at 2:03 PM, Ed Howland wrote: > Hi, I have a custom matcher that I call XMLDiff that takes an actual > XML string and an expected one and uses RSpec's normal line differ to > show the difference at the node level. It uses a method called > be_functionaly_eql, because two XML

Re: [rspec-users] Listing all specs in a given file

2009-12-28 Thread David Chelimsky
On Mon, Dec 28, 2009 at 10:48 AM, Sean Grove wrote: > I'm trying to write a simple spec dispatcher, the client-side of which > essentially does the following: > > options = Spec::Runner::OptionParser.parse( "#{file}", $stderr, std_out ) > options.line_number = line > Spec::Runner::CommandLine.run

[rspec-users] be_true and be_false

2009-12-28 Thread David Chelimsky
Hi all, The be_true and be_false matchers pass if the actual object is the singleton instance of true or false respectively. e.g. true.should be_true # passes 1.should be_true # fails "true".should be_true #fails false.should be_false # passes nil.should be_false # fails http://rspec.lighthouse

Re: [rspec-users] be_true and be_false

2009-12-28 Thread David Chelimsky
On Mon, Dec 28, 2009 at 1:04 PM, David Chelimsky wrote: > Hi all, > > The be_true and be_false matchers pass if the actual object is the > singleton instance of true or false respectively. e.g. > > true.should be_true # passes > 1.should be_true # fails > Actually, "

[rspec-users] eq(expected)

2009-12-28 Thread David Chelimsky
Hey all, I'm thinking of adding an eq(expected) matcher. Please comment in https://rspec.lighthouseapp.com/projects/5645-rspec/tickets/932 if you're interested. Cheers, David ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/ma

Re: [rspec-users] no should raise_exception

2009-12-28 Thread David Chelimsky
On Mon, Dec 28, 2009 at 2:08 PM, rogerdpack wrote: > > What I really want to say is "should raise(Blah)" but Ruby already > defines > > raise as a keyword :) > > > > I'd be open to aliasing raise_error with raise_exception, renaming it to > > raise_exception and aliasing raise_error for compatibi

Re: [rspec-users] Submitting a Custom Matcher: gem or other method?

2009-12-29 Thread David Chelimsky
On Tue, Dec 29, 2009 at 4:28 AM, Ashley Moran wrote: > > On 28 Dec 2009, at 16:27, David Chelimsky wrote: > > > For most users, gems are the easiest answer. By all means, host source on > github if you want people to contribute, or have a place to inspect code, > but yo

Re: [rspec-users] Submitting a Custom Matcher: gem or other method?

2009-12-29 Thread David Chelimsky
On Tue, Dec 29, 2009 at 9:53 AM, Ed Howland wrote: > On Tue, Dec 29, 2009 at 10:09 AM, David Chelimsky > wrote:> That said, I definitely think we need a home for information about > matchers. > > Hosting them, however, is something I'd rather leave to the professionals &

Re: [rspec-users] Running cucumber against an application

2009-12-29 Thread David Chelimsky
On Tue, Dec 29, 2009 at 9:25 PM, John Smith wrote: > Hello, I have a very simple non-web application I am trying to test > against. Say I have a library folder with several .rb files, and the one > that is to be executed is main.rb ('ruby main.rb' via command line). > How would I set up cucumber

Re: [rspec-users] Spec time reporting precision

2009-12-30 Thread David Chelimsky
On Wed, Dec 30, 2009 at 6:20 AM, Ronald Chaplin wrote: > Hey all, > So I woke up early this morning, and was running some tests through > autospec, and it returned a time as follows: > > Finished in 0.01516001 seconds > > I know that there are alot of other more important issues being > a

Re: [rspec-users] Spec time reporting precision

2009-12-30 Thread David Chelimsky
On Wed, Dec 30, 2009 at 10:26 AM, Ronald Chaplin wrote: > On Wed, 2009-12-30 at 09:26 -0600, David Chelimsky wrote: > > On Wed, Dec 30, 2009 at 6:20 AM, Ronald Chaplin > > wrote: > > Hey all, > > So I woke up early this morning, and was running som

Re: [rspec-users] more verbosity for be_an?

2009-12-30 Thread David Chelimsky
On Wed, Dec 30, 2009 at 1:33 PM, rogerdpack wrote: > before I hack up a patch for it. Would a patch to change > > "expected Fixnum to be a kind of Fixnum" > > to > > "expected Fixnum to be a kind of Fixnum (is a Class)" > > or possibly > > "expected Fixnum to be a kind of Fixnum (is a Class, Mod

[rspec-users] naming help, please

2009-12-31 Thread David Chelimsky
Hey all, If you like coming up with the perfect method name, please join the fun at https://rspec.lighthouseapp.com/projects/5645-rspec/tickets/935. Cheers, and happy new year! David ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyfor

Re: [rspec-users] Private method in custom module

2009-12-31 Thread David Chelimsky
On Thu, Dec 31, 2009 at 12:54 PM, Phillip Koebbe wrote: > I have a module of custom examples, such as > > module ControllerHelperMethods >module MyExampleGroupMethods >def should_set_the_body_id(body_id) >it "should set the body id to '#{body_id}'" d

Re: [rspec-users] Private method in custom module

2009-12-31 Thread David Chelimsky
On Thu, Dec 31, 2009 at 2:05 PM, Phillip Koebbe wrote: > Hi David, > > First, thanks for the suggestion. I like that better. > > Second, my motivation for doing this was born out of not being able to > do something I wanted to do in Remarkable. However, as I was trying to > explain what it was I w

Re: [rspec-users] more verbosity for be_an?

2010-01-02 Thread David Chelimsky
On Sat, Jan 2, 2010 at 3:23 PM, Andrew Premdas wrote: > 2009/12/30 rogerdpack > > > What about something like: >> > >> > expected # => Fixnum to be a kind of Fixnum >> > >> > That is more aligned with other failure messages. WDYT? >> >> I quite like it. >> In this instance it was >> >> 3.class

Re: [rspec-users] more verbosity for be_an?

2010-01-02 Thread David Chelimsky
On Sat, Jan 2, 2010 at 4:50 PM, Rick DeNatale wrote: > On Sat, Jan 2, 2010 at 4:35 PM, David Chelimsky > wrote: > > > > > > On Sat, Jan 2, 2010 at 3:23 PM, Andrew Premdas > wrote: > >> > >> 2009/12/30 rogerdpack > >>> > >>> &

Re: [rspec-users] disabling before filters in rspec?

2010-01-04 Thread David Chelimsky
On Sun, Jan 3, 2010 at 6:56 PM, jollyroger wrote: > Hey guys, > > i have this before-filter in my application-controller: > > def login_required >if !current_user > redirect_to join_welcome_path and return >end > end > > This before-filter is prepended before all other before-filter

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 4:33 AM, Ijonas Kisselbach < ijonas.kisselb...@gmail.com> wrote: > Hi, > > I'm struggling with structuring my specs describing a large process in my > app. There are multiple paths of execution through that process each of > which I'm trying to describe using a different rsp

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
by known attributes end it "updates most_recent_violations" do record # query for most recent violations and expect the violation # to be found end it "updates the violation count" do expect { record }.to change {content.unresolved_violation_count}.

Re: [rspec-users] Question about structuring specs

2010-01-04 Thread David Chelimsky
omething like Factory Girl or Machinist to setup the DB? To > avoid too much mocking and to avoid old-skool fixtures. > YES! Thanks for the help. > Assuming it was helpful, you're welcome. Cheers, David > > On Mon, Jan 4, 2010 at 12:56 PM, David Chelimsky wrote: >

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-04 Thread David Chelimsky
On Mon, Jan 4, 2010 at 2:57 PM, Andrew Premdas wrote: > 2009/12/30 Paul Hinze > > Given this simple cucumber feature (related to another rspec bug I am >> working on): >> >> http://gist.github.com/266335 >> >> I'm fighting with this error messages that _only_ shows up in certain >> situations t

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-05 Thread David Chelimsky
On Mon, Jan 4, 2010 at 3:00 PM, David Chelimsky wrote: > >>> >>> http://github.com/dchelimsky/rspec/blob/master/lib/spec/mocks/proxy.rb#L117 >> >> >> This method is really unpleasant, perhaps some standard refactorings to >> remove the complex cond

Re: [rspec-users] 'Expected NoMethodError, got NameError'

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 7:35 AM, Andrew Premdas wrote: > 2010/1/4 David Chelimsky > > On Mon, Jan 4, 2010 at 2:57 PM, Andrew Premdas wrote: >> >>> 2009/12/30 Paul Hinze >>> >>> Given this simple cucumber feature (related to another rspec

Re: [rspec-users] Adding stubs for an included argument

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 4:09 AM, Edvard Majakari wrote: > Hi, > > My scenario is as follows, and so far I have not found the clean way > to implement the following. > > In a method I have a method called allowed_for?(*args) used as > follows: > > ... > > if o.allowed_for?(:foo, :bar) > #case a > e

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 1:46 PM, Matt Wynne wrote: > Subclass it in your spec with > > class TestController < Admin::BaseController > def index > end > end > > ...then use the TestController in your tests for Admin::BaseController. > > That might mean you'll need to add special routing for Tes

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 2:53 PM, Phillip Koebbe wrote: > Subclass it in your spec with >> >> class TestController < Admin::BaseController >> def index >> end >> end >> >> ...then use the TestController in your tests for Admin::BaseController. >> >> That might mean you'll need to add special rou

Re: [rspec-users] get to a different controller

2010-01-05 Thread David Chelimsky
On Tue, Jan 5, 2010 at 6:44 PM, Wincent Colaiuta wrote: > El 05/01/2010, a las 21:52, Phillip Koebbe escribió: > > > Pat Maddox wrote: >> >>> The spec has Admin::BaseController as the described type. So of course >>> it's going to test against that. If you want to test a different class, you >

Re: [rspec-users] Fixtures problem with Rails plugin

2010-01-06 Thread David Chelimsky
On Wed, Dec 30, 2009 at 10:30 AM, John j. Cuckler wrote: > Hi, I just wrote some specs for a rails plugin, I'm using some > fixtures and rake:spec:plugins works fine as long as there is only > this plugin loaded in the application, but if I add another one it > doesn't load fixtures. Apart from t

Re: [rspec-users] Problem with should_not when passing a multiple args to a matcher

2010-01-06 Thread David Chelimsky
On Wed, Jan 6, 2010 at 7:15 PM, Ben Fyvie wrote: > We seem to be hitting some undesirable behavior with should_not in > combination with matchers that accept collections. Let me use the “include” > matcher for example (a co-worker reported similar problems using “be_any” so > I don’t believe this

Re: [rspec-users] get to a different controller

2010-01-06 Thread David Chelimsky
On Wed, Jan 6, 2010 at 8:53 PM, Phillip Koebbe wrote: > > > Wincent Colaiuta wrote: > >> >> Well, there is more than one way to skin a cat, but the thing I like about >> my proposed solution is that: >> >> - the specification of the behavior appears in the "describe" block that >> corresponds to t

Re: [rspec-users] Problem with should_not when passing a multipleargs to a matcher

2010-01-07 Thread David Chelimsky
Spec::Matchers.define :include_any do |*expected| match do |actual| expected.any? {|e| actual.include?(e)} end end Cheers, David > > > > > Ben Fyvie > > -- > > *From:* rspec-users-boun...@rubyforge.org [mailto: > rspec-users-boun.

Re: [rspec-users] How call a method/something after ALL specs?

2010-01-08 Thread David Chelimsky
On Fri, Jan 8, 2010 at 7:24 AM, mix wrote: > hi, is there a way to call a method/print something after ALL the > specs are run ? (with all, i mean all, after all the spec files, just > before the rspec output which say how many spec have passed).. > > i want to print some text telling which is th

Re: [rspec-users] Stubbing through multiple layers

2010-01-09 Thread David Chelimsky
On Fri, Jan 8, 2010 at 9:37 PM, DeNigris Sean wrote: > Hi list, > > I'm writing an example for a class that represents the "pickaxe" e-book, > which I view in Preview.app: > > describe PickaxeBook do > ... >it "should tell whether it's ready to read" do >preview = stub('pr

Re: [rspec-users] Stubbing through multiple layers

2010-01-10 Thread David Chelimsky
On Sat, Jan 9, 2010 at 9:38 PM, Sean DeNigris wrote: > > window = stub('window', :title => "programming_ruby_1.9.pdf") > > preview = stub('preview', :front_window => window) > Perfect - so easy! Thanks. > > > If you have good high level specs with something like Cucumber or > FitNesse, > > th

Re: [rspec-users] Code for the RSpec book

2010-01-10 Thread David Chelimsky
On Sun, Jan 10, 2010 at 3:22 PM, Onno van der Straaten < onno.van.der.straa...@gmail.com> wrote: > Hi, > I'm trying to download the code for the RSpec book from github > http://wiki.github.com/dchelimsky/rspec/code-for-the-rspec-book-beta. > > When I click 'Download Source' a window with a busy ic

Re: [rspec-users] Troubles with route_for

2010-01-11 Thread David Chelimsky
On Sun, Jan 10, 2010 at 10:58 PM, Nick Hoffman wrote: > Hey guys. I'm having some trouble with a route spec. In routes.rb , I > have: >map.connect 'foods/search/:name', :controller => :foods, :action => > :search > > foods_controller_spec.rb has: http://codepad.org/dg3FERKw > Unfortunately, t

[rspec-users] [ANN] rspec 1.3.0 Released

2010-01-11 Thread David Chelimsky
see rdoc for Spec::Matchers * and_yield provides configurable eval_context * Eric Meyer & David Chelimsky * CTRL-C actually stops execution! (Bryan Helmkamp - #911) * make drb port configurable (Chris Flipse - #875) * changed raise_error to raise_exception (#933) * kept raise_err

[rspec-users] [ANN] rspec-rails 1.3.0 Released

2010-01-11 Thread David Chelimsky
rspec-rails version 1.3.0 has been released! * * * * * Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.3.0 / 2010-01-11 *

[rspec-users] Chad Humphries

2010-01-11 Thread David Chelimsky
Welcome Chad Humphries to the Rspec Development Team! http://blog.davidchelimsky.net/2010/01/12/welcome-chad-humphries/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] nested steps

2010-01-12 Thread David Chelimsky
On Tue, Jan 12, 2010 at 4:40 PM, rogerdpack wrote: > Question. > Currently rspec appears to allow for a two-step test system, like > > context "abc" > it 'should do y' do > end > end > > It might be convenient to have an arbitrary number of nests, like > > context "abc" > it 'should do y' do >

Re: [rspec-users] Stub activerecord find given instance?

2010-01-12 Thread David Chelimsky
On Tue, Jan 12, 2010 at 6:58 PM, Saverio Miroddi wrote: > David Chelimsky wrote: > > >>> MyModel.stub(:find).with(42).and_return(myModel) > >> Didn't work as expected - I'll do a bit of research and post again. > > What is expected? What are you tryin

Re: [rspec-users] Troubles with route_for

2010-01-13 Thread David Chelimsky
On Tue, Jan 12, 2010 at 11:35 AM, Nick Hoffman wrote: > By the way, does this spec: >{:get => '/path'}.should route_to(...) > make this spec redundant?: >params_from(:get, '/path').should == {...} > Yes - route_to checks both sides of the translation. > They read the same, but it feels

Re: [rspec-users] Troubles with route_for

2010-01-13 Thread David Chelimsky
On Wed, Jan 13, 2010 at 10:20 AM, Nick Hoffman wrote: > David Chelimsky wrote: > > On Tue, Jan 12, 2010 at 11:35 AM, Nick Hoffman > > wrote: > > > >> By the way, does this spec: > >>{:get => '/path'}.should route_to(...) > >>

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread David Chelimsky
On Thu, Jan 14, 2010 at 5:46 AM, John Polling wrote: > Hi, > > I've been a .Net developer for a number of years now and I'm a big fan > of TDD / BDD. I have been following these principles for a couple of > years and use tools such as NUnit for testing purposes. > > I am now looking at moving ac

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread David Chelimsky
On Thu, Jan 14, 2010 at 6:33 AM, John Polling wrote: > Thanks for this David. > > I suppose the thing I am so used to is testing classes in isolation > whereas Cucumber is about testing everything together. > Did you do all of your testing in NUnit? When I was working on .NET apps, I used FitNe

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread David Chelimsky
On Jan 14, 2010, at 8:46 AM, Phillip Koebbe wrote: John Polling wrote: Generally what I do is drive all my individual classes out using NUnit and Rhino.Mocks and then do the acceptance testing later with FitNesse. I think this is the part that I'm confusing myself with as most Cucumber

Re: [rspec-users] Testing .Net Newbie

2010-01-14 Thread David Chelimsky
On Thu, Jan 14, 2010 at 9:26 AM, Joaquin Rivera Padron wrote: > hi > > 2010/1/14 John Polling > > Phillip Koebbe wrote: >> >> > Hi John. Maybe this will help: >> > >> > http://www.pragprog.com/titles/achbd/the-rspec-book >> > >> > It's a good book. But when you get to the part about Webrat and >>

Re: [rspec-users] Selenium client gem

2010-01-14 Thread David Chelimsky
On Thu, Jan 14, 2010 at 2:12 PM, Onno van der Straaten < onno.van.der.straa...@gmail.com> wrote: > Hi, > I'm trying to install the selenium client with gem install selenium-client. > This returns the following message > ERROR: could not find gem selenium-client locally or in a repository > > BTW,

Re: [rspec-users] Selenium client gem

2010-01-14 Thread David Chelimsky
On Thu, Jan 14, 2010 at 2:37 PM, David Chelimsky wrote: > On Thu, Jan 14, 2010 at 2:12 PM, Onno van der Straaten < > onno.van.der.straa...@gmail.com> wrote: > >> Hi, >> I'm trying to install the selenium client with gem install >> selenium-client. >>

Re: [rspec-users] autospec: non-standard filenames & redirecting output

2010-01-15 Thread David Chelimsky
On Thu, Jan 14, 2010 at 10:10 PM, DeNigris Sean wrote: > Rspec gurus, > > I have 2 questions about autospec. I've played around quite a bit, but > can't figure it out... > > 1. I got autospec to work with my directory structure > ("examples/*_example.rb"), but it only works if I have an empty sp

Re: [rspec-users] Specs fail in rake spec but not command R

2010-01-16 Thread David Chelimsky
On Sat, Jan 16, 2010 at 12:23 AM, jko170 wrote: > Surely I cannot be the only one experiencing this issue. > > I have some code that is "time/date sensitive". > > Why do some specs fail when I run rake spec, but they do not when I > use command R? > Please read http://wiki.github.com/dchelimsky/

Re: [rspec-users] specify line for autorun?

2010-01-17 Thread David Chelimsky
Yep - that's a bug - please file a ticket at http://rspec.lighthouseapp.com Thx! On Sat, Jan 16, 2010 at 9:43 PM, rogerdpack wrote: > Am I correct in assuming this should work (bug)? > > # spec.fast_require.rb contains the line require 'spec/autorun' > E:\dev\ruby\fast_ruby_require\spec>ruby sp

<    1   2   3   4   5   6   7   8   9   10   >