rack-dev-mark 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/rack/dev-mark/middleware.rb +1 -1
- data/spec/rack/dev-mark/middleware_spec.rb +19 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWVmMmU1NGIxYWQ3NGM5OTQ1ODE3NzE4NmUzMGE2MDliY2E3NjczNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTkwYThlNzUzODY2MzQzYjFhY2MzMzc0MTBlNGQxZDQwZGVmY2IyYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGQ1OTBkYjQ1Mjg3ODk5NTMyYWExYjE0YzlkYmVlMmYxOTVmNWZhYWUzODg5
|
10
|
+
NTkyMGM4ZjEzODE4ZjNkNDE1NGE1NmJkNTVkMGM4YjNiMTM1OGY5ODg4MmQ4
|
11
|
+
OTM2M2MwY2E3NjJiOTMzN2MzNDBiY2IwM2JlOGM0YTJmNDJhMjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzVlZDgwOTVkMzBjNDY0ZGNmOGJhNzEyMzZjMDE0MmZjOTM3ZGVkNzkxYjNk
|
14
|
+
MjMwNWU1MGQxNWI5NDAxMzlmODg2NWZlNzYxODE4MzAyOTA1ODJhMGRiNjFl
|
15
|
+
MjZmNTBlZjU0NjI2MThjOTYwY2FkMDYzMzNiNDk5MTMyN2M2NDk=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe Rack::DevMark::Middleware do
|
@@ -5,10 +6,12 @@ describe Rack::DevMark::Middleware do
|
|
5
6
|
let(:body) { ['response'] }
|
6
7
|
let(:theme) { d = double setup: nil; allow(d).to receive(:insert_into){ |b| "#{b} dev-mark" }; d }
|
7
8
|
let(:app) { double call: [200, headers, body] }
|
9
|
+
let(:env) { 'test' }
|
10
|
+
let(:revision) { 'rev' }
|
8
11
|
subject { Rack::DevMark::Middleware.new(app, theme) }
|
9
12
|
before do
|
10
|
-
allow(Rack::DevMark).to receive(:env).and_return(
|
11
|
-
allow(Rack::DevMark).to receive(:revision).and_return(
|
13
|
+
allow(Rack::DevMark).to receive(:env).and_return(env)
|
14
|
+
allow(Rack::DevMark).to receive(:revision).and_return(revision)
|
12
15
|
end
|
13
16
|
|
14
17
|
it "inserts dev mark" do
|
@@ -17,9 +20,20 @@ describe Rack::DevMark::Middleware do
|
|
17
20
|
expect(headers).to include('Content-Type' => 'text/html; charset=utf-8')
|
18
21
|
expect(body).to eq(["response dev-mark"])
|
19
22
|
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
describe "http headers" do
|
24
|
+
context "ASCII env string" do
|
25
|
+
it "adds http headers" do
|
26
|
+
_, headers, _ = subject.call({})
|
27
|
+
expect(headers).to include('X-Rack-Dev-Mark-Env' => 'test')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
context "Non ASCII string" do
|
31
|
+
let(:env) { 'テスト' }
|
32
|
+
it "adds http headers" do
|
33
|
+
_, headers, _ = subject.call({})
|
34
|
+
expect(headers).to include('X-Rack-Dev-Mark-Env' => '%E3%83%86%E3%82%B9%E3%83%88')
|
35
|
+
end
|
36
|
+
end
|
23
37
|
end
|
24
38
|
context "symbol theme" do
|
25
39
|
let(:theme) { :title }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-dev-mark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daisuke Taniwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|