Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created May 18, 2009 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmhodges/113417 to your computer and use it in GitHub Desktop.
Save jmhodges/113417 to your computer and use it in GitHub Desktop.
# The code in lib/foobar.rb
require 'sinatra/base'
class Foobar < Sinatra::Base
VERSION = '1.0.0'
configure do
set :foobar, environment
end
end
# The tests in test/test_foobar.rb
require "test/unit"
require "foobar"
Foobar.set :environment, :test
class TestFoobar < Test::Unit::TestCase
def setup
@app = Foobar
end
def test_sanity
assert_equal :test, @app.environment
assert_equal :test, @app.foobar, "this is the one that fails. it's :development"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment