02:20
ashley_moran joined
03:01
BrianTheCoder_ joined
03:20
jschoolcraft joined
06:16
charlenopires joined
08:14
charlenopires joined
08:21
technicalpickles joined
08:21
technicalpickles joined
09:50
<banksy34>
hello all
09:50
<banksy34>
i have a bug to report for rspec
09:50
<banksy34>
is this the best place to do it?
10:02
charlenopires joined
10:03
goatish_mound joined
10:03
goatish_mound joined
10:28
charlenopires joined
10:29
<goatish_mound>
banksy34: i believe there's a lighthouse project setup for bug reporting and patch submission.
10:31
<banksy34>
i just don't really want to create an account
10:31
<banksy34>
the issue is that autospec fails when there is a space in the path of your project directory
10:31
<banksy34>
not that big of an iisue
10:31
<banksy34>
I just fixed it by removing the space
10:38
technicalpickles joined
10:38
technicalpickles joined
11:10
<phinze>
hmm rspec-rails question: is there a nice way of saying it ('creates a foo model') { MyModel.find_by_name('foo').should_not be_nil }
11:11
<phinze>
i sort of want an ARish model.should exist i guess
11:13
<phinze>
from googling i'm guessing that `find_by_foo(...).should_not be_nil` is the best we got for now... if anyone has a better way please do ping me :)
11:24
<technicalpickles>
phinze: there's an exists? method on AR::Base
11:24
<phinze>
technicalpickles: right, but how to call that rspec-ily
11:25
<phinze>
MyModel.exists?(:name => 'foo').should be_true ... ?
11:25
<technicalpickles>
MyModel.should exist(:name => 'foo')
11:25
<technicalpickles>
there's magic to translate question-mark methods into matchers
11:25
<phinze>
aha! giving that a shot, didn't know it de-pluralized
11:25
<technicalpickles>
I think it's clever
11:25
<technicalpickles>
rspec, that is, to do that
11:26
<technicalpickles>
you could also implement a exist method, that does what you want, and gives you a good error message
11:26
<technicalpickles>
that particular one will probably fail with 'expected true, but was false'
11:26
<technicalpickles>
for example
11:26
<phinze>
ah gotchya
11:26
<phinze>
playing around with the more recent implicit subject features today
11:26
<phinze>
liking it a lot actually
11:28
<phinze>
though the cleverness+concision vs. kiss debate always rages on in my head ;)
11:31
<phinze>
hmm i think i'm running into the actual should exist method
11:36
<technicalpickles>
possibly...
11:39
<phinze>
messing with it a bit, will let you know
11:52
<phinze>
hmm.. i found the magic in the BePredicate matcher
11:53
<phinze>
MyModel.should be_exist(:name => 'foo') works
11:53
<phinze>
isn't the be_* required to activate the magic?
11:55
<danhealy>
I have autospec working on an old project. I just set up a new rails project for autospec but it doesn't work, I just get a ----- line and no specs run. it gives me a new ---- line if I save a file though
11:55
<danhealy>
I have only done this a few times, what am I missing?
11:56
<danhealy>
spec_helper.rb, spec.opts, .autotest, config/environments all look ok
12:00
<technicalpickles>
danhealy: autotest was split up into a few gems... make sure you have autotest-rails installed
12:00
<technicalpickles>
phinze: no clue dude...
12:01
<danhealy>
I have autotest-rails (4.1.0), autotest (4.2.5, 4.2.4), autotest-fsevent (0.2.1, 0.2.0, 0.1.3)
12:01
<danhealy>
does that need to be in the environments?
12:02
<danhealy>
I just have config.gem for rspec, rspec-rails and webrat
12:05
<danhealy>
hmm I ran it with -v and I get "No tests matched" for a bunch of files, eg No tests matched spec/spec_helper.rb
12:09
<danhealy>
when I run autospec -v in my old project, i get that too, but then it does the normal thing of running ruby spec --autospec <bunch of files> -0 spec/spec.opts
12:09
<danhealy>
in the new project it just doesnt do that at all
12:10
<danhealy>
-O i guess
12:10
<danhealy>
and it works if I run it manually on a file
12:28
BrianTheCoder joined
13:30
<phinze>
garg, i have a very expensive `before :all` that i want to run "once before this and all sub example groups" but it's running "once for this and once _again_ for each sub example group"
13:30
<phinze>
but i don't want before :suite -- that's too global
13:34
<phinze>
i guess friendly before :all + implicit subjectness aren't going to play nice
13:35
<phinze>
this is what i get for trying to play fancy instead of safe :P
13:57
technicalpickles joined
13:57
technicalpickles joined
17:19
technicalpickles joined
17:19
technicalpickles joined
21:36
<eadz>
when testing a view, is the layout rendered as well?
21:36
<eadz>
and is there a way to print the code in the console that the view spec is matching against?
21:52
<stef_>
if using webrat you can print last_response after a visit