Skip to content

Instantly share code, notes, and snippets.

@Musfuut
Created December 29, 2009 13:10
Show Gist options
  • Save Musfuut/265302 to your computer and use it in GitHub Desktop.
Save Musfuut/265302 to your computer and use it in GitHub Desktop.
#!/bin/sh
# This test script assumes the app is being run with
# `ruby sinatra_shared_variable_test.rb' on localhost
# port 4567.
# You can change this to your preferred automated http dump command
testapp='wget -q -O -'
$testapp http://localhost:4567/one
$testapp http://localhost:4567/show
$testapp http://localhost:4567/two
$testapp http://localhost:4567/show
$testapp http://localhost:4567/getset?word=three
$testapp http://localhost:4567/show
$testapp http://localhost:4567/pathset/four
$testapp http://localhost:4567/show
# The output containing the error should be as follows
# Variables set to: one and one
# Variables set to: one and one (They should always match)
# Variables set to: two and two
# Variables set to: two and two (They should always match)
# Variables set to: three and three
# Variables set to: three and three (They should always match)
# Variables set to: four and four
# Variables set to: three and four (They should always match)
# If the "bug" didn't exist the last line would obviously read as
# Variables set to: four and four (They should always match)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment