poisol 0.1.5 → 0.1.6

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: 694d7cf950ecd96a78b73968192fc47335da892e
4
- data.tar.gz: 5b3c8415adbcc0c6f4808d0a7bc28d89a0b56b08
3
+ metadata.gz: f9b12b86f96c1412fe9a3fefa32dbec07848f7fb
4
+ data.tar.gz: 5aae04149e21e61f90c02aaac26bbb5a50965a65
5
5
  SHA512:
6
- metadata.gz: acdd6c698dcbae2e11e8a7a277a61b8b73da52cd8177cfa1a5be524c4245aef018d37785c38f361c4bf04b0a51c04880b70f3889b2bb8b7c57056151d08b3224
7
- data.tar.gz: 488bf8adb7cf80eb01fc2e12a31cca5b3ca2d45c2c87669280f89154948b35cd712d2e5c365ebb985ee6edf6d7017fc81cc913ed9c2b741ecfddddb97cc5672f
6
+ metadata.gz: 55aa39cba2680ee3b4b7a75b95c42da992cc837f78dab5495523b2e5eb41e77b11505e743ebc2ae6f89eca8e2799160aa7aed46703c0810bc1c0edf040325728
7
+ data.tar.gz: e370d4550c402f7d9dc5153e1afcb09cf9df40cad25a472563d050d0de096d63f829ea8ccd334a39049081cd2379de321ea5748557eb4b906d46f5a7e2e3988b
@@ -37,7 +37,7 @@ module Poisol
37
37
  private
38
38
  def build_request
39
39
  load_url
40
- @stub_config.request.type = @raw_config_hash["request"]["type"].downcase
40
+ @stub_config.request.type = @raw_config_hash["request"]["method"].downcase
41
41
  load_query
42
42
  load_request_body
43
43
  end
@@ -22,13 +22,20 @@ module Poisol
22
22
  def get_stub_response stub_request
23
23
  stub = Stubs.get_match stub_request
24
24
  if stub.blank?
25
- PoisolLog.error "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^No match found for above request"
26
- PoisolLog.error "Registered requests are: #{Stubs.all.map{|stub| "\n#{stub.request.to_s}"}.join}\n--end--"
25
+ log_error stub_request
27
26
  raise "No match found for request: #{stub_request.to_s} "
28
27
  end
29
28
  PoisolLog.info JSON.pretty_generate(stub.response.body)
30
29
  return stub.response if stub.present?
31
30
  end
32
31
 
32
+ def log_error request
33
+ Kernel.puts request.to_s
34
+ Kernel.puts "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^No match found for above request"
35
+ Kernel.puts "Registered requests are: #{Stubs.all.map{|stub| "\n#{stub.request.to_s}"}.join}\n--end--"
36
+ PoisolLog.error "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^No match found for above request"
37
+ PoisolLog.error "Registered requests are: #{Stubs.all.map{|stub| "\n#{stub.request.to_s}"}.join}\n--end--"
38
+ end
39
+
33
40
  end
34
41
  end
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: first
3
- type: get
3
+ method: get
4
4
  response:
5
5
  body: '{
6
6
  "title": "1"
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: second
3
- type: get
3
+ method: get
4
4
  response:
5
5
  body: '{
6
6
  "title": "1"
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: explicit
3
- type: post
3
+ method: post
4
4
  body_explicit: true
5
5
  body:
6
6
  name: "sea"
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: keyvalue
3
- type: post
3
+ method: post
4
4
  body:
5
5
  name: "sea"
6
6
  age: 10
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: book
3
- type: get
3
+ method: get
4
4
  query:
5
5
  author: "bharathi"
6
6
  name: "doni"
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: book_explicit
3
- type: get
3
+ method: get
4
4
  query_explicit: true
5
5
  query:
6
6
  author: "bharathi"
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: column
3
- type: get
3
+ method: get
4
4
  response:
5
5
  array_type: column
6
6
  body: '{
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: row
3
- type: get
3
+ method: get
4
4
  response:
5
5
  array_type: row
6
6
  body: '{
@@ -1,6 +1,6 @@
1
1
  request:
2
2
  url: nested_array
3
- type: get
3
+ method: get
4
4
  response:
5
5
  body: '{
6
6
  "title": "ind",
@@ -1,5 +1,5 @@
1
1
  request:
2
2
  url: simple_response
3
- type: get
3
+ method: get
4
4
  response:
5
5
  body: '{"a":1,"b":2}'
@@ -1,5 +1,5 @@
1
1
  request:
2
2
  url: 'cda/{name|cd}/{actor|ragavan}/get'
3
- type: get
3
+ method: get
4
4
  response:
5
5
  body: '{"hi": 1}'
@@ -1,3 +1,3 @@
1
1
  request:
2
2
  url: users
3
- type: post
3
+ method: post
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poisol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepak