Skip to content

Instantly share code, notes, and snippets.

@lox
Created May 6, 2012 06:26
Show Gist options
  • Save lox/2620517 to your computer and use it in GitHub Desktop.
Save lox/2620517 to your computer and use it in GitHub Desktop.
Varnish::Test syntax
require 'test/unit'
require 'varnish/test'
class HelloWorldTest < Varnish::Test::TestCase
def test_it_says_hello_world
backend = Varnish::Test::Backend.new
backend.expect :get, '/', do |env|
[ 200, {}, "Hello World" ]
end
response = @varnish.get '/'
assert response.ok?
assert_equal 'Hello World', response.body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment