[Git] Gitorious on Ubuntu

Par défaut

This is the bash history to install and run Gitorious on a Ubuntu server (you need ruby-dev, rails, mongrel and git-core installed to continue).

Some pitfalls:

  • Texpow is not installing because of Onigurama, so download it and build it from sources
  • Problem: « cannot open shared object file: No such file or directory – /usr/lib/ruby/gems/1.8/gems/oniguruma-1.1.0/lib/oregexp.so« . Solution: sudo ldconfig
git clone git://gitorious.org/gitorious/mainline.git  gitorious
cd gitorious
sudo apt-get install libopenssl-ruby1.8
sudo gem install mime-types textpow -y
cp config/gitorious.sample.yml config/gitorious.yml; nano config/gitorious.yml
nano config/database.yml
rake db:migrate
mongrel_rails start

Then open your browser to http://localhost:3000

[Ruby] Behaviour Driven Development with RSpec

Par défaut

During the rewritting of Feevy.com with Merb, I’m discovering RSpec, a framework to be sure your code behave nicely.

Follow and join Feevy rewrite on Gitorious

Instead of normal test-units, you describe how your app/model should behave, which give a more-human conversation when you read your test:

  it "should create a feed from website http://blog.feevy.com" do

    feed = Feed.new :website => "http://blog.feevy.com"

    feed.valid?(:save).should == true

    feed.link.should == "http://blog.feevy.com/feed/"
    feed.website.should == "http://blog.feevy.com"
    feed.title.should == "Feevy Blog"

  end

To re-initialize your database between each test:

  before(:each) do
      Feed.delete_all
  end

Next step: writing Feevy stories