Feb 08 00:15
Feb 08 00:58
Feb 08 01:09
Feb 08 02:06
ashley_moran joined #rspec
Feb 08 02:22
Feb 08 02:32
Feb 08 02:38
Feb 08 03:10
Feb 08 03:19
Feb 08 03:24
Feb 08 04:49
Feb 08 05:09
Feb 08 05:14
Feb 08 05:26
Feb 08 06:06
Feb 08 06:21
Feb 08 06:41
Feb 08 07:10
Feb 08 07:23
Feb 08 07:35
Feb 08 08:07
Feb 08 08:13
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
Feb 08 08:30
Feb 08 08:36
emmanueloga joined #rspec
emmanuel_oga joined #rspec
Feb 08 08:50
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.
Feb 08 08:56
Feb 08 09:06
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
i understand. just saying that yr testing that you know how to write routes rather than behavior. different strokes for different folks though.
but like i said... use should raise
Feb 08 09:12
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
i thought you wanted to test the route raises routing error.
lambda { delete :destroy ... }.should raise ... [air code]
Feb 08 09:17
Feb 08 09:26
Feb 08 09:32
Feb 08 09:37
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?
Feb 08 09:45
Feb 08 09:59
technicalpickles joined #rspec
Feb 08 10:11
Feb 08 10:40
Feb 08 10:58
Feb 08 11:10
Feb 08 11:26
ashley_moran joined #rspec
Feb 08 11:41
Feb 08 11:54
fakingfantastic joined #rspec
Feb 08 12:03
ssmithstone joined #rspec
Feb 08 12:10
emmanueloga joined #rspec
Feb 08 12:16
Feb 08 12:26
Feb 08 12:47
Feb 08 12:55
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?
phinze: you can put in in a module, then do config.include in the spec_helper block
ashley_moran: will that be available at the top level of spec files so i can put require_special next to my regular requires?
oh, no it won't - i misunderstood you
yeah sorry should have explained better up front
in that case you can put it in a module and do `module Kernel; include MyModule; end`
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 :)
i suppose i could just ensure it's in scope and call it as MyModule.require_special('foo')
alright well thanks for the info ashley_moran
phinze: well now i've said that I can't make it work myself :)
Feb 08 13:00
let me go and learn how to actually program, back in 2 secs :)
phinze: fyi, I think files in spec/support/*.rb are automatically loaded
technicalpickles: ORLY -- i have Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} in my spec_helper.rb
so perhaps i can experiment with removing that :P
it might be a more recent version
has clearly forgotten how include works
ashley_moran: can you even include a module in a module?
nevermind, you definitely can
technicalpickles: apparently, and i'm sure i've done it before, but i can't make it produce any useful behaviour :)
could always look at how rspec itself adds 'describe' to the top level
Feb 08 13:06
technicalpickles: not a bad idea
is it sleep deprivation or have i just forgotten how ruby works?
ashley_moran: rspec just re-opens kernel itself
technicalpickles: so it does
i usually prefer to put things in their own namespace, but i can see why they do it that now way...
i must have imagined including a module into Kernel before
ashley_moran: sometimes people add it to Object
Feb 08 13:12
ashley_moran: yeah that is odd (your gist)
but yes if you do class Object; include MyModule; end it works
bcardarella joined #rspec
Feb 08 13:19
Feb 08 13:26
Feb 08 13:45
bcardarella joined #rspec
Feb 08 13:52
bcardarella joined #rspec
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">
charlenopires joined #rspec
actual.should eql(expected)
unsaved records are generally != iirc
If I don't want to persist them in my tests - how can I make this test pass?
it's hard to say w/o knowing what it is that is being tested
Feb 08 13:58
OK, I got your point. Thanks a lot technicapickles!
maybe you need to set expections a different way?
yeah, in this case I can just narrow my assert to one attribute
Feb 08 14:03
or mebbe @foo.attributes.should == @bar.attributes if yr really wanting to assert on all of them?
Feb 08 14:09
Feb 08 14:17
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?
Feb 08 15:11
Feb 08 15:29
Feb 08 15:35
Feb 08 15:42
Feb 08 15:56
Feb 08 16:21
Feb 08 16:30
romanandreg joined #rspec
is there a way to use a middleware in Rails Controller tests?
Feb 08 16:35
romanandreg joined #rspec
Feb 08 16:43
guys, I'm having issues with rSpec and Warden (a middleware for authentication)
it seems rSpec is not loading the middleware on purpose
so one quarter of my tests started to fail, after moving to Warden
Feb 08 17:04
Feb 08 17:26
Feb 08 17:49
technicalpickles joined #rspec
technicalpickles joined #rspec
Feb 08 17:54
Feb 08 18:05
rspec-rails: master alex rothenberg * 9c5a908 (2 files in 2 dirs): helper instance variable no longer persists across examples ...
rspec-rails: master David Chelimsky * ec2cd94 (1 files in 1 dirs): words
Feb 08 18:11
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
Feb 08 18:21
bcardarella joined #rspec
Feb 08 18:43
Feb 08 18:56
Feb 08 19:06
Feb 08 19:39
Feb 08 19:47
Feb 08 20:27
Feb 08 20:50
Feb 08 21:26
BrianTheCoder joined #rspec
bcardarella joined #rspec
Feb 08 21:36
RobotDeathSquad joined #rspec
Feb 08 21:44
anathematic joined #rspec
Feb 08 22:17
Feb 08 22:30
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]
rspec: master David Chelimsky * 10e3836 (1 files in 1 dirs): words