Displaying 20 results from an estimated 9000 matches similar to: "Something cool I learned about rspec today"
2007 Oct 17
15
Any tips on teaching BDD with RSpec?
Hi
I hope this is not OT. I''m training my replacement at work to do BDD
Rails development. He''s done a CS/maths degree but has no
professional programming experience, so he''s never NOT done a project
without BDD. In a way I am jealous of his unspoilt situation :)
I''ve gone about things this way:
* first teach him some Ruby (he did mainly Java at
2007 Oct 31
5
Rspec Release Plan (was Am I missing something with Heckle?)
On Oct 31, 2007 11:36 AM, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> When can we expect the next release of rspec?
Definitely by the end of November.
Likely by mid-November.
Hopefully in a matter of days.
The next release will be 1.1.0.
We''re going to a release model in which 1.odd.x will be considered
experimental. This means that while we will document
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
--
Sent from my mobile device
2007 Sep 03
20
Reason for _spec.rb convention
Hi
Easy one - I just wondered why all spec files for rspec_on_rails end
"_spec.rb" instead of just ".rb"? They are all inside the spec
folder so surely the fact they are specs is implicit?
Ashley
2007 Sep 03
6
blog post on story runner
Here''s an excellent blog post on Story Runner, which will be part of
the next release and is undergoing active development in trunk:
http://evang.eli.st/blog/2007/9/1/user-stories-with-rspec-s-story-runner
2006 Dec 20
8
RSpec 0.7.5
The RSpec Development Team is pleased to announce the release of RSpec 0.7.5.
This release adds support for Heckle - Seattle''rb''s code mutation tool.
There are also several bug fixes to the RSpec core and the RSpec on
Rails plugin.
Changes: http://rspec.rubyforge.org/changes.html
Download: http://rubyforge.org/frs/?group_id=797
or
gem install rspec
Happy spec''ing,
2007 Oct 31
16
Am I missing something with Heckle?
Hi
I can''t get heckle working. In fact, I''ve built an example so simple
that it either shows a bug, or I am being really, REALLY stupid.
Heckle does not appear to support RSpec directly, so I''m trying to use
spec --heckle (RSpec trunk as of 10 mins ago, Heckle 1.4.1). I''ve
constructed this pair of sample files:
18> ~/Desktop/heckle_test % cat
2007 Jun 14
4
Can''t run RSpec files in TextMate
Hi
Not sure if this is the place to ask this or not. I''ve upgraded to
RSpec 1.0.5, installed the latest TextMate bundle, but whenever I do
"Run Behaviour Descriptions in selected files/directories" I get this:
/Users/ashleymoran/Library/Application Support/TextMate/Pristine Copy/
Bundles/RSpec.tmbundle/Support/lib/spec_mate.rb:18:in `run_files'':
private method
2009 Oct 20
8
Stub that returns hash values
Is it possible to create a stub that returns hash values.
For example I would like to convert this:
@siteItem = stub(''plmSiteItem'', :one => "uno")
To something like this:
@siteItem = stub(''plmSiteItem'', {''one'' => ''uno'', ''two'' => ''dos''} )
So that I can do this:
2007 Aug 08
9
RSpec book?
<http://www.apress.com/book/bookDisplay.html?bID=10368>
Came across this as a stub page browsing Amazon UK. This is good
news! I''m surprised it hasn''t been discussed on the list before.
Was Chad keeping it a secret?
I hope it will have plenty of BDD theory. I''m still waiting for that
magic book I can give to someone and say "here - read this, it
2007 Jun 27
6
Aspects in RSpec 1.0.5
Forgot post this when I did it...
For anyone else that used the "aspect" method of the rspec-ext gem,
here''s a New World version of the code to drop into spec_helper.rb.
(I''m assuming rspec-ext hasn''t been updated since I did this a week
or two ago)
module Spec
module DSL
module BehaviourEval
module ModuleMethods
def
2006 May 25
3
Storing BigDecimal in the db
I need to do some precise math, going to 12-14 decimal places, so I''m
using BigDecimal. How can I store this in a db? I''m using postgresql
8.1.0, if that matters at all. I found a plugin [1] but it gives me
the error "You have a nil object when you didn''t expect it! The error
occurred while evaluating nil.each_pair," with no line number. The
plugin itself
2007 Apr 04
2
[PLUGIN] ArPaginator - Allows you to easily paginate over any existing AR queries.
The built-in Rails pagination is fairly limited...you pass in the
model name, and optionally some conditions, and it generates a
paginated query for you. This gets to be very bad if you''ve got any
custom queries.
class Company < ActiveRecord::Base
def complete_videos
Video.find :all, :conditions => "company_id=#{id} AND
status=''complete''", :order
2007 Oct 21
10
Preferred mock framework
Hi
In light of the fact that RSpec mocks are going into maintenance mode
in the near future, I was wondering what everyone was switching to.
I liked the look of FlexMock most, so gave that a shot. However,
there''s a few things that don''t work well with RSpec due to the
traditional differences in the way Test::Unit cases are written vs
RSpec specs. (One spec per
2006 Dec 18
2
should_receive and multiple return values
Hi
I just got bit by a misunderstanding about and_return.
I''ve got this controller method parse_parameters that loops over
query string parameters and parses out vehicle registration dates.
We have to turn these into one of three bands (Jan-Feb, Mar-Aug, Sep-
Dec) so I wrote a method (registration_date_to_band_year_and_month)
takes a date and returns two return values, the year
2007 Oct 21
18
plain text stories
Thanks to discussions on this list, suggestions from many of you and a
patch from Pat Maddox, we now have Plain Text User Stories in Story
Runner.
Read more:
http://blog.davidchelimsky.net/articles/2007/10/21/story-runner-in-plain-english
Cheers,
David
2008 Jan 21
3
Story runner "macros"
I''ve gotten quite a bit out of Pat Maddox''s screencast
http://evang.eli.st/blog/2007/10/8/story-runner-top-to-bottom-screencast
One thing I''m not sure of is the feature where he writes things like:
When "I POST to", "/articles", :post => {:title => "Title", :body
=> "Body") do | path, params|
post_via_redirect
2007 Jun 27
2
Controller specs not shareable?
Hi
I just wondered if there was a reason why Rails controller specs are
not shareable? eg
describe "All XHR POSTs to /gap/calculate_quote", :shared => true do
controller_name :gap
# ...
end
describe "XHR POST /gap/calculate_quote with valid details" do
it_should_behave_like "All XHR POSTs to /gap/calculate_quote"
# ...
end
blows up with
2007 Oct 23
10
How is everyone structuring stories?
Bleeding-edge story-writers,
How are you structuring your specs?
I am working on a new project and tried this:
./lib
./blah
./spec
./blah
./stories
But it breaks autotest, so I moved stories parallel to lib and spec.
Also what about suffixes?
I have adopted "xyz_story_spec.rb", and "xyz.story" for the time
being, with the line
runner =
2007 Feb 13
7
Specs of code that use Time.now
Hi
Just trying to spec a Rails model that defaults a valid_until date to
this time tomorrow. I''ve done something similar involving Dates, and
you can stub the :today method to return something fixed. But when I
tried this with Time, I found that RSpec calls Time.now four times
per spec. So there''s no way to spec code like 1.days.from_now . The
best I can come up