Thanks for the link - but i'm looking for a simple standalone example.
The simplest example I was able to find is on the Webrat wiki. See
http://wiki.github.com/brynary/webrat/sinatra - simple but the code
doesn't work...
Here is my sinatra app - app.rb:
require 'rubygems'; require 'sinatra'
get '/' do 'hello world' end
Here is my modified test example - test.rb:
require "rubygems"
require "webrat"
require "webrat/sinatra"
require "test/unit"
require "app"
Webrat.configure do |config|
config.mode = :rack
end
class AppTest < Test::Unit::TestCase
include Webrat::Methods
include Webrat::Matchers
def test_it_works
visit "/"
assert_contain("hello world")
end
end
I run this with `ruby test.rb`, and get an error:
ArgumentError: tried to create Proc object without a block
...
...
I'm using Sinatra 0.9.4, Webrat 0.5.3, Ubuntu 9.04, Ruby 1.8.7.
How can I make this work ???