02:06
ashley_moran joined
08:13
<jamuraa>
how would I test that a route doesn't exist? for example, I want to be sure that I don't have a :destroy route
08:36
emmanuel_oga joined
08:50
<rsl>
should raise?
08:50
<rsl>
i never test routing though. imo that's like testing that AR::Base.find does what it should. but i know lots of ppl who do test it.
09:06
<jamuraa>
rsl: I guess I just want to make sure a :destroy route doesn't appear, letting things be destroyed that shouldn't be allowed to be destroyed
09:07
<rsl>
i understand. just saying that yr testing that you know how to write routes rather than behavior. different strokes for different folks though.
09:07
<rsl>
but like i said... use should raise
09:12
<jamuraa>
hmm, my assigns[:var] doesn't seem to be working right. if I p @thing in my controller, but if I put p assigns[:thing] in my test right after, it is nil
09:15
<rsl>
i thought you wanted to test the route raises routing error.
09:16
<rsl>
lambda { delete :destroy ... }.should raise ... [air code]
09:17
<jamuraa>
I did, I moved on.
09:41
<kW_>
Hello! Does anybody use rspec for verification? That is: not some software is tested, but some data structure is ensured that it conforms to certain restrictions?
09:59
technicalpickles joined
11:26
ashley_moran joined
11:54
fakingfantastic joined
12:55
<phinze>
hey folks, where is the best place to put a special require helper method i'm going to use in my specs, i assume that def require_special(filename); ... ; end in spec_helper is not ideal?
12:56
<ashley_moran>
phinze: you can put in in a module, then do config.include in the spec_helper block
12:57
<phinze>
ashley_moran: will that be available at the top level of spec files so i can put require_special next to my regular requires?
12:57
<ashley_moran>
oh, no it won't - i misunderstood you
12:57
<phinze>
yeah sorry should have explained better up front
12:58
<ashley_moran>
in that case you can put it in a module and do `module Kernel; include MyModule; end`
12:58
<phinze>
ah okay, so specs execute in Kernel context... i'm hesitant to add to that. i'm probably already gold-plating my current task anyways, so i can just move along :)
12:59
<phinze>
i suppose i could just ensure it's in scope and call it as MyModule.require_special('foo')
12:59
<phinze>
alright well thanks for the info ashley_moran
13:00
<ashley_moran>
phinze: well now i've said that I can't make it work myself :)
13:00
<ashley_moran>
let me go and learn how to actually program, back in 2 secs :)
13:01
<technicalpickles>
phinze: fyi, I think files in spec/support/*.rb are automatically loaded
13:02
<phinze>
technicalpickles: ORLY -- i have Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} in my spec_helper.rb
13:02
<phinze>
so perhaps i can experiment with removing that :P
13:02
<technicalpickles>
it might be a more recent version
13:02
<* ashley_moran>
has clearly forgotten how include works
13:03
<technicalpickles>
ashley_moran: can you even include a module in a module?
13:04
<technicalpickles>
nevermind, you definitely can
13:04
<ashley_moran>
technicalpickles: apparently, and i'm sure i've done it before, but i can't make it produce any useful behaviour :)
13:04
<technicalpickles>
could always look at how rspec itself adds 'describe' to the top level
13:06
<phinze>
technicalpickles: not a bad idea
13:07
<ashley_moran>
is it sleep deprivation or have i just forgotten how ruby works?
13:09
<technicalpickles>
ashley_moran: rspec just re-opens kernel itself
13:10
<ashley_moran>
technicalpickles: so it does
13:10
<ashley_moran>
i usually prefer to put things in their own namespace, but i can see why they do it that now way...
13:10
<ashley_moran>
i must have imagined including a module into Kernel before
13:11
<technicalpickles>
ashley_moran: sometimes people add it to Object
13:12
<phinze>
ashley_moran: yeah that is odd (your gist)
13:13
<phinze>
but yes if you do class Object; include MyModule; end it works
13:53
<agilezencd>
Can anyone give me an advice about this failed asser? expected #<ScheduledFlashcard id: nil, flashcard_id: 1, execute_at: "2010-02-08 20:57:03"> got #<ScheduledFlashcard id: nil, flashcard_id: 1, execute_at: "2010-02-08 20:57:03">
13:53
charlenopires joined
13:54
<agilezencd>
actual.should eql(expected)
13:54
<technicalpickles>
unsaved records are generally != iirc
13:54
<agilezencd>
If I don't want to persist them in my tests - how can I make this test pass?
13:56
<technicalpickles>
it's hard to say w/o knowing what it is that is being tested
13:58
<agilezencd>
OK, I got your point. Thanks a lot technicapickles!
13:59
<technicalpickles>
maybe you need to set expections a different way?
14:00
<agilezencd>
yeah, in this case I can just narrow my assert to one attribute
14:03
<rsl>
or mebbe @foo.attributes.should == @bar.attributes if yr really wanting to assert on all of them?
14:09
<agilezencd>
I'll try. Thanks
14:20
<tvw>
I am just writing a spec for a controller. By moving all repeating code into a before(:each)-block, I noticed, that one test got empty. Is this ok?
16:34
<romanandreg>
guys, quick question
16:34
<romanandreg>
is there a way to use a middleware in Rails Controller tests?
16:43
<romanandreg>
guys, I'm having issues with rSpec and Warden (a middleware for authentication)
16:43
<romanandreg>
it seems rSpec is not loading the middleware on purpose
16:44
<romanandreg>
so one quarter of my tests started to fail, after moving to Warden
17:49
technicalpickles joined
17:49
technicalpickles joined
18:05
<GitHub81>
rspec-rails: master alex rothenberg * 9c5a908 (2 files in 2 dirs): helper instance variable no longer persists across examples ...
18:05
<GitHub81>
rspec-rails: master David Chelimsky * ec2cd94 (1 files in 1 dirs): words
18:11
<GitHub60>
rspec-rails: master David Chelimsky * 2a51fba (1 files in 1 dirs): memoize the helper in the example instead of in the group -
http://bit.ly/c6shJE
21:26
BrianTheCoder joined
21:36
RobotDeathSquad joined
22:32
<GitHub166>
rspec: master Scott Taylor * 2753b49 (2 files in 2 dirs): Fix delegation of stubbed values on superclass class-level methods. Closes LH[#957 state:resolved], LH[#496 state:resolved]
22:32
<GitHub166>
rspec: master David Chelimsky * 10e3836 (1 files in 1 dirs): words