Piku’s Blog

February 4, 2008

Installing rspec with Braid [Updated]

Filed under: Git, Ruby on Rails — Tags: , , , , , , , , , — Mihai @ 7:08 pm

See my Braid 0.4 post for informations about how to upgrade.

Updated to work with the latest version (0.3.1)

Braid is a tool made by Cristi Balan and is a simple tool to help track vendor branches across different SCMs.

It was originally named giston, and was providing functionality similar to piston for git. Braid, however, will work with most SCMs as both source and host.

Warning, Braid is still under development and may change in the future.

To start you need to get and install, on a linux like my ubuntu you can do it by writing:

mihai@mihai-laptop:~$ sudo gem install main open4
mihai@mihai-laptop:~$ git clone git://github.com/evilchelu/braid.git braid
mihai@mihai-laptop:~$ cd braid
mihai@mihai-laptop:~$ sudo ruby setup.rb

For this example I will use it to install rspec (the development version) on a Rails project. Go to your project root and type:
(more…)

Advertisements

January 27, 2008

Testing subdomains as account keys

Filed under: Ruby on Rails — Tags: , , , — Mihai @ 6:49 pm

I am using subdomains as account keys and some tests failed for controllers, they were looking for the account but didn’t find it.

The trick is to rewrite the host in the tests. Here’s the code for rspec.



  before(:each) do

    @request.host = 'piku.mysite.net'

  end

Here, before each test the url is rewritten and the filter that finds the account happily does it job.

January 23, 2008

Going at Wurbe #5

Filed under: News — Tags: , , , — Mihai @ 10:36 pm

Monday I went to a meeting of Bucharest web developers called Wurbe (web urbe). The topic was Testing: Unit-testing, TDD, BDD.

Octavian Costache (Vivi) held a very nice speech about why it is good to test and very important how unit testing will improve your sex life (but mainly your code). He succeeded convincing me and started writing more tests.

Other interesting talks were Cosmin Lehene’s talk about TDD, Adrian Spinei about testing webapps in windows where he demoed testing Gmail using WatiN, Mihai Bulhac about using Watir, Bogdan Roman with Selenium and Cristi Balan and Sergiu Truta with RSpec and respectively RSpec stories.

All in all it was very interesting to find out why it is good to test and that most major companies use it. It seems that TDD is indeed proving useful. I actually improved my unit tests and really take care about code coverage. You can view the slides on wurbe website (most of them are in english).

Create a free website or blog at WordPress.com.