aitch 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de38868979f48b300cc6c7bcf89867eb5a6c763f
4
- data.tar.gz: 44071a93ca9d00f5adb3f8324ae12421818ae63d
3
+ metadata.gz: d0dfe4472432f59487033b0e4ee493309ca64ea1
4
+ data.tar.gz: 7ac2a7504a11fd303cae76c2f626c4ef3e1a8d4e
5
5
  SHA512:
6
- metadata.gz: 21f5737e0c0ace3b19f464c54020194d3a7ba5debef88853e6c93248f7ae4845447d830f4852c3fcdcdee351f7afde456df37107dcf2bd309053bf98a9d7d21f
7
- data.tar.gz: 6adb9a4df4c44b6ff700ba5e2e9f49fa42d65eed09cfd3800a462b947c1389f414bff7efb9409b88f3aa1abe173fb38c9d75f8c94a9c66879f7ddda685669423
6
+ metadata.gz: 572b6bd663e91bbfbd40bb1fec56656f7c9ddb6ed36ad4b60ed8595bb87b991ce4aa2a27819521af915e539d0042e27dc07155a4f22d09d29b2ab71cda212078
7
+ data.tar.gz: 390ff3a7a9dbffd717bbc2b6076e1e46801ed050f03c977ad0a63f77701d8366d539e2025e00f6bc61726897b19954961be44f80f54636153bf75e38586eeae3
data/.gitignore CHANGED
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ Gemfile.lock
@@ -1,24 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aitch (0.4.0)
4
+ aitch (0.4.1)
5
5
  activesupport
6
6
  nokogiri (>= 1.6.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (4.1.8)
12
- i18n (~> 0.6, >= 0.6.9)
11
+ activesupport (4.2.0)
12
+ i18n (~> 0.7)
13
13
  json (~> 1.7, >= 1.7.7)
14
14
  minitest (~> 5.1)
15
- thread_safe (~> 0.1)
15
+ thread_safe (~> 0.3, >= 0.3.4)
16
16
  tzinfo (~> 1.1)
17
17
  awesome_print (1.2.0)
18
+ byebug (3.5.1)
19
+ columnize (~> 0.8)
20
+ debugger-linecache (~> 1.2)
21
+ slop (~> 3.6)
18
22
  coderay (1.1.0)
23
+ columnize (0.9.0)
24
+ debugger-linecache (1.2.0)
19
25
  diff-lcs (1.2.5)
20
26
  fakeweb (1.3.0)
21
- i18n (0.6.11)
27
+ i18n (0.7.0)
22
28
  json (1.8.1)
23
29
  method_source (0.8.2)
24
30
  mini_portile (0.6.1)
@@ -30,13 +36,14 @@ GEM
30
36
  coderay (~> 1.1.0)
31
37
  method_source (~> 0.8.1)
32
38
  slop (~> 3.4)
33
- pry-meta (0.0.9)
39
+ pry-byebug (2.0.0)
40
+ byebug (~> 3.4)
41
+ pry (~> 0.10)
42
+ pry-meta (0.0.10)
34
43
  awesome_print
35
44
  pry
36
- pry-nav
45
+ pry-byebug
37
46
  pry-remote
38
- pry-nav (0.2.4)
39
- pry (>= 0.9.10, < 0.11.0)
40
47
  pry-remote (0.1.8)
41
48
  pry (~> 0.9)
42
49
  slop (~> 3.0)
@@ -40,7 +40,7 @@ module Aitch
40
40
  end
41
41
 
42
42
  def content_type
43
- headers['Content-Type']
43
+ headers['Content-Type'] || options.fetch(:default_headers, {})['Content-Type']
44
44
  end
45
45
 
46
46
  def request
@@ -1,3 +1,3 @@
1
1
  module Aitch
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -75,6 +75,16 @@ describe Aitch::Request do
75
75
  expect(request.body).to eql({a: 1}.to_json)
76
76
  end
77
77
 
78
+ it "sets json body from object (default headers)" do
79
+ request = build_request(
80
+ request_method: "post",
81
+ data: {a: 1},
82
+ options: {json_parser: JSON, default_headers: {'Content-Type' => 'application/json'}}
83
+ ).request
84
+
85
+ expect(request.body).to eql({a: 1}.to_json)
86
+ end
87
+
78
88
  it "sets request body from to_h protocol" do
79
89
  data = double(to_h: {a: 1})
80
90
  request = build_request(request_method: "post", data: data).request
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri