[rspec-users] Caveman Questions

David Chelimsky dchelimsky at gmail.com
Wed Sep 5 20:31:49 EDT 2007

On 9/5/07, sudara <sudara at modernthings.net> wrote:
> Hello!
> I'm just a caveman with some caveman questions.
> I've been parsing Rspec for quite a while, and I'm writing my first series
> of specs. My initial impressions are "Verbose, but understandable. Helpful
> and intuitive, but so much to digest." I want to congratulate the folks who
> are dedicating a chunk of their lives to writing this, and ask 2 caveman
> questions
> My first is "Why lambda in rpsec"? It doesn't strike me as "reads like
> english" or "easily understandable." I understand it's place in ruby (um,
> kind of :), but my thinking is:
> lambda { do_something_risky }.should raise_error
> would be more understandable (and fun!) written as:
> running { something_risky }.should raise_error

That's a great idea. Why don't you add it to the tracker:


> My second question is: For those folks who are getting up to speed with ruby
> and rails AND digesting rspec along the way, there is a lot of incoming DSL.
> As I started with rails before rspec, I found myself using script/console to
> check my code, poking at different ways of expressing myself with ruby.
> Is there a way to "poke at my specs"? I can load up my test environment, but
> can I spec things "live" so that I can find out what works and what doesn't?
> I find I'm wasting a chunk of time (as I don't have the DSL even 60% down)
> writing specs and getting it wrong. Am I missing a trick, or I.should_have
> dsl_down_before_trying.else_return(crying)?

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'spec'
=> true
irb(main):003:0> include Spec::Matchers
=> Object
irb(main):004:0> 5.should == 5
=> nil
irb(main):005:0> 5.should be < 4
Spec::Expectations::ExpectationNotMetError: expected < 4, got 5


> um, thanks for any potential caveman responses - the more caveman
> (pragmatic) the better.
> sudara
> --
> View this message in context: http://www.nabble.com/Caveman-Questions-tf4384357.html#a12498949
> Sent from the rspec-users mailing list archive at Nabble.com.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list