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

Commit

Permalink
Add regression tests and update Gemfile.lock / dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Apr 8, 2015
1 parent e7b5cd2 commit 890771e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 16 deletions.
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# Changelog

## 0.1.8 (2014-02-09)
## 0.1.9 (2015-04-08)

* Add regression tests for issue #5
* Update Gemfile.lock / dependencies
* Fix dates in this CHANGELOG

## 0.1.8 (2015-02-09)

* Add tests to ensure URLs with query parameters are maintained

## 0.1.7 (2014-02-02)
## 0.1.7 (2015-02-02)

* Refactor and simplify `revalidate_response()` method

## 0.1.6 (2014-02-02)
## 0.1.6 (2015-02-02)

* Don't rescue ArgumentError on httpdate parse errors

## 0.1.5 (2014-02-02)
## 0.1.5 (2015-02-02)

* Closes #3. Returns all cached headers according to RFC 7234 sec4.3.4

## 0.1.4 (2014-02-01)
## 0.1.4 (2015-02-01)

* HTTP `Age` header is now returned as a String, but processed as an Integer
30 changes: 19 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,45 @@ GEM
specs:
ansi (1.5.0)
builder (3.2.2)
coveralls (0.7.8)
coveralls (0.8.0)
multi_json (~> 1.10)
rest-client (~> 1.7)
rest-client (>= 1.6.8, < 2)
simplecov (~> 0.9.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
docile (1.1.5)
domain_name (0.5.23)
unf (>= 0.0.5, < 1.0.0)
fakeweb (1.3.0)
http-cookie (1.0.2)
domain_name (~> 0.5)
mime-types (2.4.3)
minitest (5.5.1)
minitest-reporters (1.0.8)
minitest-reporters (1.0.11)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
multi_json (1.10.1)
netrc (0.10.2)
multi_json (1.11.0)
netrc (0.10.3)
rake (10.4.2)
rest-client (1.7.2)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
ruby-progressbar (1.7.1)
simplecov (0.9.1)
ruby-progressbar (1.7.5)
simplecov (0.9.2)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
simplecov-html (~> 0.9.0)
simplecov-html (0.9.0)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
tins (1.3.3)
tins (1.3.5)
unf (0.1.4)
unf_ext
unf_ext (0.0.6)

PLATFORMS
ruby
Expand Down
29 changes: 29 additions & 0 deletions test/test_regressions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class TestRegressions < MiniTest::Test

#
# Bugfix tests to ensure we don't allow regressions
#
# https://github.com/aw/CacheRules/issues

def setup
@cached_headers = {
:cached => {
"Date" => {"httpdate"=>"Thu, 01 Jan 2015 07:03:45 GMT", "timestamp"=>1420095825},
"Cache-Control" => {
"public" => {"token"=>nil, "quoted_string"=>nil}
},
"X-Cache-Req-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625},
"X-Cache-Res-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625}
}
}
end

# https://github.com/aw/CacheRules/issues/5
def test_bugfix_5_age_header_string_integer
age_string = CacheRules.action_add_age @cached_headers
age_integer = CacheRules.helper_corrected_initial_age({}, Proc.new { 100 }, Proc.new { 99 }).call

assert_kind_of String, age_string['Age']
assert_kind_of Integer, age_integer
end
end

0 comments on commit 890771e

Please sign in to comment.