rack-weinre 1.0.0 → 1.0.1

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-weinre (0.0.1)
4
+ rack-weinre (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Weinre
3
- VERSION = '1.0.0'
3
+ VERSION = '1.0.1'
4
4
  end
5
5
  end
data/lib/rack/weinre.rb CHANGED
@@ -14,6 +14,8 @@ module Rack
14
14
  body << line.sub(/(?=<\/head>)/, tag(env))
15
15
  end
16
16
  orig.close if orig.respond_to?(:close)
17
+
18
+ res[1]['Content-Length'] = body.join.size.to_s if res[1]['Content-Length']
17
19
  end
18
20
  end
19
21
  else
@@ -13,6 +13,12 @@ describe Rack::Weinre do
13
13
 
14
14
  context "when response type is text/html" do
15
15
  it { should have_css 'head script[src="http://www.example.com:8080/target/target-script-min.js#anonymous"]' }
16
+
17
+ context "and Content-Length is given" do
18
+ let(:body){ '<!DOCTYPE html><html><head><title>foo</title></head><body>bar</body></html>' }
19
+ let(:app){ stub_app(:headers => {'Content-Length' => body.size.to_s}, :body => [body]) }
20
+ it { expect{ subject }.not_to raise_error }
21
+ end
16
22
  end
17
23
 
18
24
  context "when response type is not text/html" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-weinre
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000 Z
12
+ date: 2012-04-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
16
- requirement: &70156904912900 !ruby/object:Gem::Requirement
16
+ requirement: &70212928675380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70156904912900
24
+ version_requirements: *70212928675380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70156904912400 !ruby/object:Gem::Requirement
27
+ requirement: &70212928674880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 2.9.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70156904912400
35
+ version_requirements: *70212928674880
36
36
  description: rack-weinre inserts a script tag that loads a weinre target js into html
37
37
  files.
38
38
  email: