Created
May 6, 2012 06:26
-
-
Save lox/2620517 to your computer and use it in GitHub Desktop.
Varnish::Test syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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