[rspec-users] Rspec tasks with rspec-rails 2.0

2010-09-13 Thread Kyle
After updating to Rails 3 and Rspec-rails 2.0, the tasks defined in rspec.rake do not work anymore. I instead get this, even when running the rake tasks via 'bundle exec': * You are trying to run an rspec rake task defined in * /Users/bessieandkyle/code/listsite/lib/tasks/rspec.rake, * but rsp

Re: [rspec-users] before(:all)

2009-06-09 Thread Kyle Hargraves
On Sun, Jun 7, 2009 at 9:40 PM, lawrence.pit wrote: > Hi, > > I took a stab at this and created what I call Machinery. So far it > works great for me. > > For those that are looking for a way to create objects in the database > in a before(:all) instead of a before(:each) to speed up tests, have a

Re: [rspec-users] uber-rcov for both cucumber & rspec

2008-12-08 Thread Kyle Hargraves
On Mon, Dec 8, 2008 at 11:56 AM, Rupert Voelcker <[EMAIL PROTECTED]> wrote: > I've had a quick look at the rake tasks for rspec and cucumber (and > rcov), but not having payed with rake very much I can't at the moment > get my head around what I need to do so am hoping for some > guidance > > W

Re: [rspec-users] Vim tree plugin?

2008-10-27 Thread Kyle Hargraves
On Sun, Oct 26, 2008 at 4:11 PM, Steve <[EMAIL PROTECTED]> wrote: > Does anyone know if there's a vim plugin out there that will show a tree of > your describe/it blocks at a glance. Preferably with click ability to go > right to that location? It'd be awesome to have a ctags-esque feature for vie

Re: [rspec-users] Someone please name this matcher for me

2008-08-07 Thread Kyle Hargraves
On Wed, Aug 6, 2008 at 1:25 PM, Cohen, Joseph <[EMAIL PROTECTED]> wrote: > > Consider: > should_have_the_same_members_as Similarly, I have a have_same_elements_as(arr) matcher. k ___ rspec-users mailing list [email protected] http://rubyforge.or

Re: [rspec-users] Stopping example execution?

2008-06-28 Thread Kyle Hargraves
On Sat, Jun 28, 2008 at 5:57 PM, Britt Mileshosky <[EMAIL PROTECTED]> wrote: > > Hello, I'm wondering If I am missing something here when creating an example > that sets an expecation at the top or beginning of an action but requires you > to stub / mock everything that follows. > > Example: > I

Re: [rspec-users] MVC testing vs. models & Webrat+RailsStory?

2008-06-20 Thread Kyle Hargraves
On Thu, Jun 19, 2008 at 11:56 AM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > Kyle, thanks much for sharing your experience. You mention the speed > and so on. I've read that it is slow. Question: does Autotest work > the same way with stories, or have a way to detect wh

Re: [rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?

2008-06-19 Thread Kyle Hargraves
On Thu, Jun 19, 2008 at 12:32 PM, Lori M Olson <[EMAIL PROTECTED]> wrote: > Would you have an example of such an exception to share? > > Thanks, Lori The .autotest at the base of one of my plugins, which updates a .sqlite3: Autotest.add_hook :initialize do |at| at.add_exception('spec/db/tracks_

Re: [rspec-users] MVC testing vs. models & Webrat+RailsStory?

2008-06-19 Thread Kyle Hargraves
On Thu, Jun 19, 2008 at 9:31 AM, Christopher Bailey <[EMAIL PROTECTED]> wrote: > Specifically, I'm wondering, or contemplating, if I do unit tests for > my models, and then I use WebRat plus RailsStory, do I even need to > then do functional testing of my controllers and views? I can see > that I

Re: [rspec-users] Autotest/RSpec 1.1.4/Rails 2.1 Infinite Loop?

2008-06-19 Thread Kyle Hargraves
On Thu, Jun 19, 2008 at 9:41 AM, Jim Lindley <[EMAIL PROTECTED]> wrote: >>> I just got back from RailsConf, and upgraded on of my development apps to >>> 2.1, and now autotest is going into an infinite loop. It runs tests >>> continuously instead of waiting for files to be saved before rerunning. >

Re: [rspec-users] Reusing story snippets

2008-06-14 Thread Kyle Hargraves
On Sat, Jun 14, 2008 at 5:03 AM, Mikel Lindsaar <[EMAIL PROTECTED]> wrote: > 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

Re: [rspec-users] Rails integration tests without stories

2008-06-07 Thread Kyle Hargraves
On Sat, Jun 7, 2008 at 3:16 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> I started with user stories, but the conversion to english was >> difficult for something largely developer-facing. "When I get >> /widgets/:id" where :id is actually determined behind the scenes did >> not read well, and

[rspec-users] Rails integration tests without stories

2008-06-07 Thread Kyle Hargraves
h of least resistance is probably using the test/unit tests, followed closely by just sucking it up and having awkward user stories. My preferred solution would be the IntegrationExampleGroup, and I may yet get that to work, but I thought I'd ask here while I sit on it for a bit. Thanks Ky

Re: [rspec-users] How to write a test for validates_uniqueness_of

2008-05-20 Thread Kyle Hargraves
On Tue, May 20, 2008 at 6:59 PM, T K <[EMAIL PROTECTED]> wrote: > Hi, > > I have a spec > > it "should have a unique username " > > I have a code: > > validates_uniqueness_of :user_name > > > Now, I don't know how to test this code. In order to test this, do I > need to run `save`? > > For exampl

Re: [rspec-users] Are you writing "imperative" or "declarative" scenarios in your stories?

2008-05-11 Thread Kyle Hargraves
", "Type XYZ in this field", etc. One or two of those don't bother me, but I move on to more abstract language -- Bryan's "When I add Zed Shaw" -- once it's solid enough to elide the details. Sometimes I go back and edit the initial scenarios, sometimes I don'

Re: [rspec-users] Date comparisons

2008-05-03 Thread Kyle Hargraves
On Sat, May 3, 2008 at 1:12 PM, Steve Downey <[EMAIL PROTECTED]> wrote: > Is there more precision than seconds in a Time instance? > > irb(main):006:0> a,b = Time.now, Time.now > => [Sat May 03 11:06:31 -0700 2008, Sat May 03 11:06:31 -0700 2008] > irb(main):007:0> puts a.to_i, b.to_i > 1209837991

Re: [rspec-users] newbq: Organizing your stories

2008-04-11 Thread Kyle Hargraves
ng a user, editing them, and removing them. Anything that does more interesting work is then done separately (users/reports.story, perhaps), but often relies on the steps for users/crud to walk through the application and set up the data. Though, as mentioned in the other thread, sometimes I just use AR

Re: [rspec-users] Command line story runner

2008-04-04 Thread Kyle Hargraves
On Fri, Apr 4, 2008 at 7:02 AM, Kamal Fariz <[EMAIL PROTECTED]> wrote: > Hi Kyle, > > I tried the story runner against a story. Unfortunately, it had > problems executing webrat methods like 'visits'. > > Kindly check out this pastie: http://pastie.org/17520

Re: [rspec-users] Command line story runner

2008-04-04 Thread Kyle Hargraves
On Fri, Apr 4, 2008 at 5:21 PM, Joe Van Dyk <[EMAIL PROTECTED]> wrote: > On Thu, Apr 3, 2008 at 7:58 AM, Kyle Hargraves <[EMAIL PROTECTED]> wrote: > > Hullo all, > > > > It sucks to write wrapper .rb files just so stories/all.rb can find > > and run t

[rspec-users] Command line story runner

2008-04-03 Thread Kyle Hargraves
ly do so soon enough. (Also, specs =) This is very tied to the layout of my own projects, and I'd be surprised if it works out of the box for most people. Right now it does mostly everything I need, so I'm curious what would be necessary to make it a viable tool for others to use. ty

Re: [rspec-users] newb q: Can story steps report a view rendering error?

2008-04-02 Thread Kyle Hargraves
;, should suffice. webrat, for example, wraps its requests in a method 'request_page()', and after every request it calls 'assert_response :success' so that the story will fail fast. Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] [ANN] rspec_hpricot_matchers 1.0: have_tag on hpricot

2008-03-26 Thread Kyle Hargraves
projects, and I haven't come up with any features I want lately, so it's reasonably stable in my experience. Usage examples are available in the README, and the specs are simple enough to be another good set of examples. Suggestions, patches and angry flames

Re: [rspec-users] should have_tag outside Rails

2008-03-18 Thread Kyle Hargraves
On Tue, Mar 18, 2008 at 9:04 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > On 17/03/2008, Kyle Hargraves <[EMAIL PROTECTED]> wrote: > > > We discussed this in a ticket on lighthouse, and I ended up writing a > > workalike that's sitting atop hpricot. It'

Re: [rspec-users] should have_tag outside Rails

2008-03-17 Thread Kyle Hargraves
e. > > Ashley We discussed this in a ticket on lighthouse, and I ended up writing a workalike that's sitting atop hpricot. It's not quite identical, but generally close enough and so far does everything I've needed: http://github.com/pd/rspec_hpricot_matchers Patches and/or suggestions welcome if you need anything else out of it Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Failed specs spike autotest

2008-02-15 Thread Kyle Hargraves
Thank you much. On Fri, Feb 15, 2008 at 12:07 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > The source of the bug was a patch that we applied a while back. This > was after the 1.1.3 release, so if you're using 1.1.3 you're fine. If > you're using trunk, go ahead and update and you should be

Re: [rspec-users] Failed specs spike autotest

2008-02-14 Thread Kyle Hargraves
ly after failures. The problem continues whether I use .autotest files or not. This is on a Rails 2.0.2 project, with rspec+rspec_on_rails r3306 in vendor/plugins, and ZenTest 3.9.1 installed as a gem. Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Converting to Rails 2.0.2

2007-12-28 Thread Kyle Hargraves
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 12/28/07, s.ross <[EMAIL PROTECTED]> wrote:

Re: [rspec-users] Story runner rake task

2007-12-19 Thread Kyle Hargraves
es/all.rb" end task 'stories:rcov' do sh "rcov -o story_coverage --exclude stories stories/all.rb" end Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Fwd: Vim integration.

2007-12-16 Thread Kyle Hargraves
tely worth checking out. Refs: http://www.vim.org/scripts/script.php?script_id=1567 - rails.vim http://biodegradablegeek.com/2007/12/13/using-vim-as-a-complete-ruby-on-rails-ide/ - found this when googling for rails.vim, looks useful Kyle ___ rspec

Re: [rspec-users] "Tricks" for testing after_create callback???

2007-12-12 Thread Kyle Hargraves
a more elegant approach, but the block syntax to should_receive() could allow something like: expected_message = Message.new(msg_creation_params) SantasMailbox.should_receive(:deliver_secret_santa) do |msg| msg.body.should == expected_message.body msg.subject.should == expected_message.subject # etc. if it's necessary end Message.create(msg_creation_params) Feels clunky, though. Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] namespaced controllers

2007-12-12 Thread Kyle Hargraves
ne and just be explicit about the module. describe Admin::FooController Problem goes away. I probably shouldn't even call it a workaround -- it's a solution. The only change is a minor difference in style. Kyle ___ rspec-users mailing li

Re: [rspec-users] namespaced controllers

2007-12-12 Thread Kyle Hargraves
rspec's bug, but never bothered to reply here or update the ticket I filed. Just did: http://rspec.lighthouseapp.com/projects/5645/tickets/145-namespaced-controller-load-order Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Story HTML Formatter

2007-12-09 Thread Kyle Hargraves
d up yet and/or this is a bug. Maybe I'm just being dumb. I have no clue at this time of night/morning. Thanks Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] namespaced controllers

2007-11-25 Thread Kyle Hargraves
On Nov 25, 2007 9:23 AM, Kyle Hargraves <[EMAIL PROTECTED]> wrote: > On Nov 23, 2007 11:53 PM, Scott Taylor <[EMAIL PROTECTED]> wrote: > > I got an "unknown action foo" error message (wasn't getting it before > > today - running on trunk). > > > &

Re: [rspec-users] namespaced controllers

2007-11-25 Thread Kyle Hargraves
e specs were passing fine. I went to add ::SomeController, and the new specs for it passed, but Admin::SomeController started raising UnknownAction (for all the actions that weren't defined in the non-admin controller). But once I restarted autotest, they're passing cleanly, and

Re: [rspec-users] namespaced controllers

2007-11-23 Thread Kyle Hargraves
.. > end How has the top one failed? I use it exclusively and haven't ever noticed a problem. Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] RSpec on Rails 2.0

2007-11-14 Thread Kyle Hargraves
; Cheers, > David I see people make this mistake fairly often. Is there any reason the tag shouldn't be renamed to something less counter-intuitive? Thinking of FreeBSD's tags, RELEASE perhaps? Kyle ___ rspec-users mailing list rspec-use

Re: [rspec-users] it "should [action] ..." vs it with an active voice

2007-11-12 Thread Kyle Hargraves
rk, I prefer 'it has 4 entries' to 'it should have 4 entries'. (Though, in the code, the use of 'should' to express the expectation, does make sense, as the Rubinius page explains). Thanks for bringing this up, I'd been thinking about it lately. Kyle ___ rspec-users mailing list [email protected] http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Isolating rails model specs from their implementation

2007-07-29 Thread Kyle Hargraves
= Project.active_projects.all? { |p| p.active? } all_active.should be_true end So the entirety really only hinges on active? and archived? working properly. And if active? is just !archived?, there's only one real spot from which errors will start cascading. HTH, Kyle

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

2007-07-24 Thread Kyle Hargraves
didn't even think of using a uniq on the has_many. I was using a > validates_uniquness_of :scope => 'book_id' > > I will definitley look into this one. > > Thankyou > Daniel However you decide to go about solving it, th

Re: [rspec-users] Dealing with nested/namespaced classes w/ describe

2007-07-23 Thread Kyle Hargraves
gt; > Scott Taylor You can put the descriptions inside of modules. AFAICT, this has no effect on how anything functions, it just lets you drop the namespacing ugliness from your code: module SomeProject class SomeClass end end module SomeProject describe SomeClass, "something or o

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

2007-07-18 Thread Kyle Hargraves
er than a line, and 'specify do' reads poorly -- which may be what you have against it, too. So far, I've just tried to avoid that... Of course, I say that now, and then someone will have a great suggestion for a word that makes tons more sense. Kyle __