April 2008
1 post
Heroku →
October 2007
3 posts
GSpec for Java BDD « Can’t see nothing but the... →
tutorial - driving view behaviour with... →
Coding Horror: Can Your Team Pass The Elevator... →
September 2007
1 post
Saikuro : A Cyclomatic Complexity Analyzer →
August 2007
7 posts
RSpec-1.0.6 released →
JAOO presentation: applying-agile-to-ruby →
JAOO presentation: agile-dsl-development-in-ruby →
the { buckblogs :here }: Writing Domain Specific... →
Creating DSLs with Ruby →
Dead Programmer Society: Ruby Domain Specific... →
Technology As If People Mattered : Weblog →
July 2007
22 posts
Using rspec formatter as tracking tool
BDD correctly applied means you do not change the code unless you have an example spec first. So if you add the output of an rspec run to your repository, it should be possible to track your progress based on its changes.
Just look at your trac timeline and see which lines are added to your spec output. In an ideal situation each modified line would match some changes you made to the code.
To...
Raaum's Rails Reader: ActionController →
Mike Clark's Weblog →
Install JRuby and Build a Ruby on Rails... →
Restful authentication, Rspec and Edge
I am using the Restful authentication plugin and tried to make it work with these rspec scripts. On rails edge it fails because of the use of the redirect_to_url which is deprecated. The code is fixed in memphisto but not yet in the authentication plugin.
Not always fun to mix and match moving targets.
vaporbase →
Another blogger writing about rspec experiences.
Railscasts - Free Ruby on Rails Screencasts →
Ryan's Scraps →
What is in edge.
Slides about testing validations →
Getting to the internals
What if you want to write an example of behaviour which is internal to the class. You can use the mock framework to set expectations or you can expose the the internals. I do not mind modifying the code and making things public to make it testable, however I like the way I can just open a class in my examples. I can leave the production code as is and still be able to look at the internals of the...
Rspec on Jruby →
Scaffolded code slips through rcov
The ‘else’ part of this scaffolded code is not covered by the generated controller spec.
# POST /orders
# POST /orders.xml
def create
@order = Order.new(params[:order])
respond_to do |format|
if @order.save
flash[:notice] = 'Order was successfully created.'
format.html { redirect_to(@order) }
format.xml { render :xml => @order, :status => :created,...
Monkey Knife Fight! →
Free Human Information Processing Course →
The real power of open source
Coming from a Microsoft and later on a Java programming environment I still need to get accustomed to the fast pace in the Rails community.
With Microsoft technology I just had to wait until Microsoft added or fixed a feature I needed.
With Java open source libraries, the code could be patched from existing patches or my own fixes.
I never bothered and just used the binaries, which is...
There is already a patch for using assert_select_rjs with a proxy.
Just run the patch from the actionpack root.
patch -p0 < add_assert_select_rjs_calls_for_chained_replace_page_calls.diff
Easily create fixtures. Especially handy for associations between models.
Railscasts →
Rspec and RJS
Creating an rspec example for an RJS template is pretty straightforward:
it "should replace 'payment'" do
render "payments/new.rjs"
response.should have_rjs(:replace_html, "payment")
end
Currently have_rjs can not detect the use of proxies like:
page[:payment].replace_html :partial => "payment"
You need to use:
page.replace_html "payment", :partial => "payment"
I was wondering...
Ruby syntax highlighting on tumblr
I have ruby syntax highlighting thanks to DrNic and Henrik N.
Code coverage for restful actions
If a respond_to block in a restful action is run for one type, rcov wrongly assumes the blocks for the other types are also covered.
If you put the code in a seperate function, rcov will correctly detect it if it is not tested.
def new
@payment = Payment.new(params[:payment])
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @payment }
format.js...