Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from aw/allow-newer-rubies
Browse files Browse the repository at this point in the history
Allow newer rubies
  • Loading branch information
aw committed Apr 28, 2015
2 parents 8d6a652 + 81d2bfa commit 653cca1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.12 (2015-04-28)

* Allow newer rubies

## 0.1.11 (2015-04-20)

* Remove Gemfile.lock
Expand Down
4 changes: 2 additions & 2 deletions cache_rules.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require 'date'

Gem::Specification.new do |s|
s.name = 'cache_rules'
s.version = '0.1.11'
s.version = '0.1.12'

s.date = Date.today.to_s

Expand All @@ -28,5 +28,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'simplecov'

s.licenses = ['MPL-2.0']
s.required_ruby_version = ::Gem::Requirement.new("~> 1.9")
s.required_ruby_version = ::Gem::Requirement.new(">= 1.9")
end
18 changes: 17 additions & 1 deletion test/test_validations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ def setup
"X-Cache-Res-Date" => date
}
}
@headers_stale = {
:request => {
"If-Modified-Since" => if_modified,
"Cache-Control" => cache_control
},
:cached => {
"Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
"Cache-Control" => {
"public" => {"token"=>nil, "quoted_string"=>nil},
"max-stale" => {"token"=>"100", "quoted_string"=>nil}
},
"Last-Modified" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
"X-Cache-Req-Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217},
"X-Cache-Res-Date" => {"httpdate"=>"Tue, 28 Apr 2015 09:26:57 GMT", "timestamp"=>1430213217}
}
}
@headers_noetag = {
:request => {
"If-None-Match" => ["\"myetag\""]
Expand Down Expand Up @@ -121,7 +137,7 @@ def test_only_if_cached
def test_allow_stale
guard1 = CacheRules.validate_allow_stale? @no_headers
guard2 = CacheRules.validate_allow_stale? @headers_noetag
max_stale = CacheRules.validate_allow_stale? @headers
max_stale = CacheRules.validate_allow_stale? @headers_stale
min_fresh = CacheRules.validate_allow_stale? @cached_rule2
nothing = CacheRules.validate_allow_stale? @headers_nothing

Expand Down

0 comments on commit 653cca1

Please sign in to comment.