Skip to content

Commit

Permalink
Store exists.
Browse files Browse the repository at this point in the history
Of course, it's just a module with a Hash. We'll get there!
  • Loading branch information
steveklabnik committed Dec 17, 2012
1 parent 297700a commit d47ae02
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Rakefile
@@ -1 +1,12 @@
require "bundler/gem_tasks"

require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << "lib"
t.test_files = FileList['test/*_test.rb']
t.ruby_opts = ['-r./test/test_helper.rb']
t.verbose = true
end

task :default => :test
6 changes: 5 additions & 1 deletion lib/request_store.rb
@@ -1,5 +1,9 @@
require "request_store/version"

module RequestStore
# Your code goes here...
@store = {}

def self.store
@store
end
end
11 changes: 11 additions & 0 deletions test/request_store_test.rb
@@ -0,0 +1,11 @@
require 'minitest/autorun'

require 'request_store'

class RequestStoreTest < Minitest::Unit::TestCase
def test_quacks_like_hash
RequestStore.store[:foo] = 1
assert_equal 1, RequestStore.store[:foo]
assert_equal 1, RequestStore.store.fetch(:foo)
end
end
Empty file added test/test_helper.rb
Empty file.

0 comments on commit d47ae02

Please sign in to comment.