cache_rules 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,21 +1,27 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.8 (2014-02-09)
3
+ ## 0.1.9 (2015-04-08)
4
+
5
+ * Add regression tests for issue #5
6
+ * Update Gemfile.lock / dependencies
7
+ * Fix dates in this CHANGELOG
8
+
9
+ ## 0.1.8 (2015-02-09)
4
10
 
5
11
  * Add tests to ensure URLs with query parameters are maintained
6
12
 
7
- ## 0.1.7 (2014-02-02)
13
+ ## 0.1.7 (2015-02-02)
8
14
 
9
15
  * Refactor and simplify `revalidate_response()` method
10
16
 
11
- ## 0.1.6 (2014-02-02)
17
+ ## 0.1.6 (2015-02-02)
12
18
 
13
19
  * Don't rescue ArgumentError on httpdate parse errors
14
20
 
15
- ## 0.1.5 (2014-02-02)
21
+ ## 0.1.5 (2015-02-02)
16
22
 
17
23
  * Closes #3. Returns all cached headers according to RFC 7234 sec4.3.4
18
24
 
19
- ## 0.1.4 (2014-02-01)
25
+ ## 0.1.4 (2015-02-01)
20
26
 
21
27
  * HTTP `Age` header is now returned as a String, but processed as an Integer
data/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :test do
4
4
  gem 'coveralls', require: false
5
+ gem 'rest-client', "~> 1.7.0"
5
6
  gem "rake"
6
7
  gem "fakeweb", "~> 1.3"
7
8
  gem 'minitest', '~> 5.5.0'
data/Gemfile.lock CHANGED
@@ -3,9 +3,9 @@ GEM
3
3
  specs:
4
4
  ansi (1.5.0)
5
5
  builder (3.2.2)
6
- coveralls (0.7.8)
6
+ coveralls (0.8.0)
7
7
  multi_json (~> 1.10)
8
- rest-client (~> 1.7)
8
+ rest-client (>= 1.6.8, < 2)
9
9
  simplecov (~> 0.9.1)
10
10
  term-ansicolor (~> 1.3)
11
11
  thor (~> 0.19.1)
@@ -13,27 +13,27 @@ GEM
13
13
  fakeweb (1.3.0)
14
14
  mime-types (2.4.3)
15
15
  minitest (5.5.1)
16
- minitest-reporters (1.0.8)
16
+ minitest-reporters (1.0.11)
17
17
  ansi
18
18
  builder
19
19
  minitest (>= 5.0)
20
20
  ruby-progressbar
21
- multi_json (1.10.1)
22
- netrc (0.10.2)
21
+ multi_json (1.11.0)
22
+ netrc (0.10.3)
23
23
  rake (10.4.2)
24
- rest-client (1.7.2)
24
+ rest-client (1.7.3)
25
25
  mime-types (>= 1.16, < 3.0)
26
26
  netrc (~> 0.7)
27
- ruby-progressbar (1.7.1)
28
- simplecov (0.9.1)
27
+ ruby-progressbar (1.7.5)
28
+ simplecov (0.9.2)
29
29
  docile (~> 1.1.0)
30
30
  multi_json (~> 1.0)
31
- simplecov-html (~> 0.8.0)
32
- simplecov-html (0.8.0)
31
+ simplecov-html (~> 0.9.0)
32
+ simplecov-html (0.9.0)
33
33
  term-ansicolor (1.3.0)
34
34
  tins (~> 1.0)
35
35
  thor (0.19.1)
36
- tins (1.3.3)
36
+ tins (1.3.5)
37
37
 
38
38
  PLATFORMS
39
39
  ruby
@@ -44,4 +44,5 @@ DEPENDENCIES
44
44
  minitest (~> 5.5.0)
45
45
  minitest-reporters (~> 1.0.0)
46
46
  rake
47
+ rest-client (~> 1.7.0)
47
48
  simplecov
data/cache_rules.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'date'
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = 'cache_rules'
9
- s.version = '0.1.8'
9
+ s.version = '0.1.9'
10
10
 
11
11
  s.date = Date.today.to_s
12
12
 
@@ -0,0 +1,29 @@
1
+ class TestRegressions < MiniTest::Test
2
+
3
+ #
4
+ # Bugfix tests to ensure we don't allow regressions
5
+ #
6
+ # https://github.com/aw/CacheRules/issues
7
+
8
+ def setup
9
+ @cached_headers = {
10
+ :cached => {
11
+ "Date" => {"httpdate"=>"Thu, 01 Jan 2015 07:03:45 GMT", "timestamp"=>1420095825},
12
+ "Cache-Control" => {
13
+ "public" => {"token"=>nil, "quoted_string"=>nil}
14
+ },
15
+ "X-Cache-Req-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625},
16
+ "X-Cache-Res-Date" => {"httpdate"=>"Sat, 03 Jan 2015 07:03:45 GMT", "timestamp"=>1420268625}
17
+ }
18
+ }
19
+ end
20
+
21
+ # https://github.com/aw/CacheRules/issues/5
22
+ def test_bugfix_5_age_header_string_integer
23
+ age_string = CacheRules.action_add_age @cached_headers
24
+ age_integer = CacheRules.helper_corrected_initial_age({}, Proc.new { 100 }, Proc.new { 99 }).call
25
+
26
+ assert_kind_of String, age_string['Age']
27
+ assert_kind_of Integer, age_integer
28
+ end
29
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cache_rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-09 00:00:00.000000000 Z
12
+ date: 2015-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fakeweb
@@ -103,6 +103,7 @@ files:
103
103
  - test/test_cache_rules.rb
104
104
  - test/test_formatting.rb
105
105
  - test/test_helpers.rb
106
+ - test/test_regressions.rb
106
107
  - test/test_tables.rb
107
108
  - test/test_validations.rb
108
109
  homepage: https://github.com/aw/CacheRules