Re: [rspec-users] cucumber generator error in rails 3

2010-09-27 Thread Tero Tilus
use `bundle list` and `bundle show` to see what you have and where did they come from. `script/rails g` should list the generators you have, including the two Cucumber generators. Bundler basics, see http://gembundler.com/rationale.html -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/

Re: [rspec-users] Good practices on spec'ing views?

2010-05-01 Thread Tero Tilus
ssion issue with views (as I regard them) is getting browsers to render them right (enough). If somebody does (even partially) automatized (even single browser) render testing, I'm all ears. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ __

Re: [rspec-users] should and != operator

2009-10-12 Thread Tero Tilus
2009-10-12 22:18, Tero Tilus: > Expression x!=y is instead just syntactic sugar for !(x==y). To illustrate how this affects #should, think of 'some string'.should != 'some string' Now Ruby internals kick in and desugar this (before anything is even executed) to

Re: [rspec-users] should and != operator

2009-10-12 Thread Tero Tilus
for !(x==y). > it "should fail but passes" do > [].should != [] > 'some string'.should != 'some string' > end How about it "fails now" do [].should_not == [] 'some string'.should_not == 'some string' end -- Tero Til

Re: [rspec-users] [RSpec, Rails] POST create action spec and before_filter

2009-05-19 Thread Tero Tilus
context? -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] [RSpec, Rails] POST create action spec and before_filter

2009-05-18 Thread Tero Tilus
ceed? Comment the other example one out and then try again. Generally you shouldn't expect your examples (or specs) to run in any particular order. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Tero Tilus
t;complete", I dare to ask if you do script/spec -b or something else? -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Tero Tilus
steps to reproduce? > Please please please focus: Nobody is asking how to debug We are trying. You did not tell you did debugging, so we told you to try it, because it is usually the first step. Please, don't take it personally that we might not all know you and your debug-fu. ;) -- Tero

Re: [rspec-users] what has RSpec got against stack traces?

2009-03-07 Thread Tero Tilus
maybe I just suck at deduction. ;) > Am I the first person in history to hit a programming error inside > RSpec?? What makes you suspect you are? -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyfor

[rspec-users] ActiveRecord::Base.should_receive(:find) fails

2009-02-19 Thread Tero Tilus
ptions are passed on correctly' undefined method `find' for MyModel And docs tell that (at least something really close to that one) should work http://rspec.info/documentation/mocks/partial_mocks.html -- Tero Tilus ## 050 3635 235 ## h

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Tero Tilus
2009-02-12 21:27, Mark Wilden: > It seems logical that #errors_on would call valid? Otherwise, how > would it know? ...and that's exactly what I thought too. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing

Re: [rspec-users] Is #valid? automatically called?

2009-02-12 Thread Tero Tilus
g that yourself from source is only one click away if you you have dug yourself that deep in rspec-rails rdoc. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] IRB-like utility for Cucumber?

2009-01-14 Thread Tero Tilus
2009-01-14 18:23, Sebastian W.: > "interactive Cucumber" session similar to irb? I can imagine it (when combined with Selenium) being not only cool, but very useful tool when writing features. Kinda same way console is useful when writing code. -- Tero Tilus ## 050 363

Re: [rspec-users] IRB-like utility for Cucumber?

2009-01-14 Thread Tero Tilus
2009-01-14 18:47, aslak hellesoy: > What value vould it bring over plain old: > cucumber features/scratchpad.feature:34 You gotta admit that at least the cool-factor would be pretty high. :) -- Tero Tilus ## 050 3635 235 ## http://tero.til

Re: [rspec-users] Why can not a BigDecimal be compared to a Float via "==". How should I handle this???

2009-01-11 Thread Tero Tilus
ain yourself to cry out "delta" without even thinking. ;) Would this work for you? big_decimal_variable.should be_close(123.23, 0.005) -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforg

Re: [rspec-users] Examples not getting rolled back...

2009-01-09 Thread Tero Tilus
idate"? Could I git clone 1.1.12 somewhere? I'd love to do that. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Examples not getting rolled back...

2009-01-08 Thread Tero Tilus
order they are defined and rake spec in reverse order. And that of course makes ClassFoo.should have(:no).records fail when run _after_ examples that create ClassFoo instances (befause ive got transactions off and the db state "bleeds" within one describe. 2009-01-07 16:11, Tero Tilus: >

Re: [rspec-users] Examples not getting rolled back...

2009-01-08 Thread Tero Tilus
2009-01-07 23:23, Tero Tilus: > 2009-01-07 13:08, David Chelimsky: > > Is the app code opening transactions? > > Yes, but only one spot (iirc) which is not anywhere near the model > whose test is failing here. I'll verify tomorrow that the failing > test really d

Re: [rspec-users] Examples not getting rolled back...

2009-01-07 Thread Tero Tilus
2009-01-07 13:08, David Chelimsky: > Is the app code opening transactions? Yes, but only one spot (iirc) which is not anywhere near the model whose test is failing here. I'll verify tomorrow that the failing test really doesn't run the app code in question. -- Tero Tilus ##

Re: [rspec-users] Examples not getting rolled back...

2009-01-07 Thread Tero Tilus
2009-01-07 13:04, Stephen Eley: > config.use_transactional_fixtures in config.spec_helper.rb? Tried true, false and commenting out. I could not see any difference. -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing l

[rspec-users] Examples not getting rolled back...

2009-01-07 Thread Tero Tilus
of course, what can I do about this... A bit more stuff in pastie http://pastie.org/354521 -- Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Database.truncate_all

2008-12-07 Thread Tero Tilus
2008-12-05 08:32, Jeff Talbot: > I want to clear out the database after every run so my tests are > isolated. Maybe a minor detail, but I'd suggest you clear out the db _before_ each run. -- Tero Tilus ## 050 3635 235 ## http://ter

Re: [rspec-users] rake spec defaults to devel env

2008-09-29 Thread Tero Tilus
2008-09-26 20:19, Jonathan Linowes: > rake spec looks at the development environment to prepare the db > schema, but still runs the specs in test Looks like you're right. I haven't really had time to test this though. I'll tell when I really know whats going on inside our

[rspec-users] rake spec defaults to devel env

2008-09-26 Thread Tero Tilus
do. Is this how it should go? Am I missing something? If there's something broken in my rails app where should I start debugging? -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforg

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Tero Tilus
2008-09-25 14:04, Nick Hoffman: > I knew there was a dead simple answer to the question. Thanks, Tero. > Apologies for the brain fart. Np. Done the same quite a few times myself. ;) -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/kot

Re: [rspec-users] #stub! and #should_receive on the same method

2008-09-25 Thread Tero Tilus
2008-09-25 13:47, Nick Hoffman: > I'm calling #stub! and #should_receive on the same method within a > class, and am finding that the method doesn't return the value given > to #stub! How about GMarker.should_receive(:new).with(foo).and_return mock_marker -- Tero Ti

Re: [rspec-users] scenarios on production data

2008-09-08 Thread Tero Tilus
e in your tests and then go debugging. That way you aren't actually using production data as test data, but using it to develop the test data. And isn't that (reproducing a crack in production env into tests) just what the Laziness[1] is for too? [1] http://agilewebdevelopment.com/p

Re: [rspec-users] scenarios on production data

2008-09-08 Thread Tero Tilus
database risks blurring the > line between the well specified behaviour of your app and the pile > of crap users inevitably fill it with. IMHO. That's exactly why you should not test against production data. However, could RSpec be handy tool to build a gadget to point out the poop?

Re: [rspec-users] story vs feature (was Documentation for Plain-Text Stories)

2008-08-30 Thread Tero Tilus
2008-08-30 17:02, Matt Wynne: > RuBehave Now _that's_ cool! I love it! -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] WDYT, simple, anonymous story listeners?

2008-08-12 Thread Tero Tilus
the motivation, I'm bound to hate it. ;) > This is influenced from the joys of JavaScript. It even looks like JavaScript. :D -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyfo

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

2008-08-06 Thread Tero Tilus
s not what Pat had in mind. Or was it? And include_all_and_nothing_but is a bit verbose. :) -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

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

2008-08-06 Thread Tero Tilus
ual_to be_set_equal_to Set equality is slightly (imo not fatally) incorrect, and multiset might be alien to majority of hackers out there. I'd prefer either of these or modifications. -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ __

Re: [rspec-users] $LOAD_PATH problem when creating rake task

2008-07-29 Thread Tero Tilus
2008-07-29 12:14, Luis Lavena: > > Oh dear! You made my day. \o/ > that means it worked? :-) Yes. :) -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforge.org http://ruby

Re: [rspec-users] $LOAD_PATH problem when creating rake task

2008-07-29 Thread Tero Tilus
2008-07-29 11:59, Luis Lavena: > Did you require rubygems first? Oh dear! You made my day. \o/ -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mail

[rspec-users] $LOAD_PATH problem when creating rake task

2008-07-29 Thread Tero Tilus
/1.8/i386-linux", "."] Now what? What would be a kosher way around this, maybe ln -s something somewhere? I can see the issue being discussed though, https://bugs.launchpad.net/ubuntu/+source/libgems-ruby/+bug/145267 -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero

Re: [rspec-users] Rspec - stubbing same class multiple times with different co

2008-07-22 Thread Tero Tilus
ing User.stub!(:find).and_return { ... calculate retval ... } or User.stub!(:find).and_return(@user, @user2) see http://rspec.info/documentation/mocks/stubs.html > Any ideas as to why this is not working? or better still how to get > it working. Uhh, no idea, sorry. -- Tero

Re: [rspec-users] BDD/Rails/Shoulda

2008-05-01 Thread Tero Tilus
hen I write > the specs? Lucky you if you are able to do that. I've noticed I'm not. -- Tero Tilus ## 050 3635 235 ## http://www.tilus.net/koti/tero/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cleaning up after stories

2008-03-19 Thread Tero Tilus
On Wed, 19 Mar 2008, Joe Van Dyk wrote: > do I have to manually clear out the database after a story runs? I'm wondering the same, but with specs. Database gets dirty and tests start to fail when i repeatedly do rake spec. -- Tero Tilus ## +358 (0)50 3635 235 ## http://www.tilus.net/k