My Blog

All about my activities, Ideas and everything.

Cucumber + Capybara + Sinatra

This post is not to provide a tutorial of how to combine those three awesome applications together, but it might stop you from scratching your head when the test cannot be run correctly.

  1. You need to have Sinatra in subclass style rather than classic style. Sinatra subclass-style
  2. This is quite importance, you might find some website that is using Spec. but you need to change it to be “RSpec” in order for it to work.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require File.join(File.dirname(__FILE__), '..', '..', '/server.rb')

require 'rspec'
require 'rspec/expectations'
require 'rack/test'
require 'capybara'
require 'capybara/cucumber'
require 'capybara/envjs'

App.set(:environment, :test)

World do
  Capybara.app = App
  Capybara.javascript_driver = :envjs
  include Capybara
  include RSpec::Expectations
  include RSpec::Matchers
end

Prague in december 2011

Everybody might say, why would you want to be in Prague in December where it’s cold and depressing. If you’re lucky like me, you would find a sunny day when you can walk around in the Christmas market. I say Prague it’s the place where you can visit anytime you want. Even though, the weather can be a bit tricky, but you still have a lot to do in Prague or even in Czech Republic.

Brixton Village

Why when I say to people that I’ll go to Brixton, everybody just says “Why somebody would want to go there”. And here’s why.