Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2295 Bytes
1 | require "#{File.dirname(__FILE__)}/spec_setup" |
2 | require 'rack/cache/options' |
3 | |
4 | module Rack::Cache::Options |
5 | option_accessor :foo |
6 | end |
7 | |
8 | class MockOptions |
9 | include Rack::Cache::Options |
10 | def initialize |
11 | @env = nil |
12 | initialize_options |
13 | end |
14 | end |
15 | |
16 | describe 'Rack::Cache::Options' do |
17 | before { @options = MockOptions.new } |
18 | |
19 | describe '#set' do |
20 | it 'sets a Symbol option as rack-cache.symbol' do |
21 | @options.set :bar, 'baz' |
22 | @options.options['rack-cache.bar'].should.equal 'baz' |
23 | end |
24 | it 'sets a String option as string' do |
25 | @options.set 'foo.bar', 'bling' |
26 | @options.options['foo.bar'].should.equal 'bling' |
27 | end |
28 | it 'sets all key/value pairs when given a Hash' do |
29 | @options.set :foo => 'bar', :bar => 'baz', 'foo.bar' => 'bling' |
30 | @options.foo.should.equal 'bar' |
31 | @options.options['rack-cache.bar'].should.equal 'baz' |
32 | @options.options['foo.bar'].should.equal 'bling' |
33 | end |
34 | end |
35 | |
36 | it 'makes options declared with option_accessor available as attributes' do |
37 | @options.set :foo, 'bar' |
38 | @options.foo.should.equal 'bar' |
39 | end |
40 | |
41 | it 'allows setting multiple options via assignment' do |
42 | @options.options = { :foo => 'bar', :bar => 'baz', 'foo.bar' => 'bling' } |
43 | @options.foo.should.equal 'bar' |
44 | @options.options['foo.bar'].should.equal 'bling' |
45 | @options.options['rack-cache.bar'].should.equal 'baz' |
46 | end |
47 | |
48 | it "allows storing the value as a block" do |
49 | block = Proc.new { "bar block" } |
50 | @options.set(:foo, &block) |
51 | @options.options['rack-cache.foo'].should.equal block |
52 | end |
53 | |
54 | it 'allows the cache key generator to be configured' do |
55 | @options.should.respond_to :cache_key |
56 | @options.should.respond_to :cache_key= |
57 | end |
58 | |
59 | it 'allows the meta store to be configured' do |
60 | @options.should.respond_to :metastore |
61 | @options.should.respond_to :metastore= |
62 | @options.metastore.should.not.be nil |
63 | end |
64 | |
65 | it 'allows the entity store to be configured' do |
66 | @options.should.respond_to :entitystore |
67 | @options.should.respond_to :entitystore= |
68 | @options.entitystore.should.not.be nil |
69 | end |
70 | |
71 | it 'allows log verbosity to be configured' do |
72 | @options.should.respond_to :verbose |
73 | @options.should.respond_to :verbose= |
74 | @options.should.respond_to :verbose? |
75 | @options.verbose.should.not.be.nil |
76 | end |
77 | |
78 | end |