rtomayko (owner)

Fork Of

Revisions

gist: 113420 Download_button fork
public
Public Clone URL: git://gist.github.com/113420.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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 "sinatra/base"
Sinatra::Base.set :environment, :test
 
require "test/unit"
require "foobar"
 
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