mockserver-client 1.0.4 → 1.0.6.pre

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: 00fead1db5d272c1c677221beea0341436bcf3ee
4
- data.tar.gz: df2e7477ecc5704eb538af7251cb129d3e3097dc
3
+ metadata.gz: cb049f3c5af0f80da1a3a8f317d553f4b67c68c6
4
+ data.tar.gz: c37ae55ab3ed301a9c40f3c7c3705dbc6e6a1795
5
5
  SHA512:
6
- metadata.gz: 356286ca6dd15aa9182335af329558f05c4ae37cd479baf8dc7264a83463ae5a578f4a8ba7911a94b488abf181742c8eb86e5a30c6312c7e3863b4c20f575fe8
7
- data.tar.gz: 43cdb0b6ec3aacc357d2c41772836f9818522203ebdc55ba7aea88e693c1e37e86f1c13563ee437250446208b228f369b6a62751b1ab1de3472500a2b4011c27
6
+ metadata.gz: cea9f1fe007d9f5f94a6994c05de9c11f5b387ae0fe7b84be1e2e46fbf6b87f5de927fcf8d278bfd4587ac9796a38c92092afcc6da43055342c2e8eee4806274
7
+ data.tar.gz: a1a925b8a65c9315452fad19903c99227f95455bd2a8090288f3209d96e985558f2e6eff75089a97e34e7be8cd53511c6abaae8027e641c00b0f4be4f86df87b
@@ -11,7 +11,7 @@ module MockServer::Model
11
11
  # An enum for body type
12
12
  class BodyType < SymbolizedEnum
13
13
  def allowed_values
14
- [:STRING, :REGEX, :XPATH, :PARAMETERS]
14
+ [:STRING, :REGEX, :XPATH, :PARAMETERS, :BINARY]
15
15
  end
16
16
  end
17
17
 
@@ -13,7 +13,7 @@ module MockServer::Model
13
13
  # @raise [Exception] if the supplied value is not valid for this enum
14
14
  def initialize(supplied_value)
15
15
  supplied_value = pre_process_value(supplied_value)
16
- fail "Supplied value: #{supplied_value} is not valid. Allowed values are: #{supplied_value}" unless allowed_values.include?(supplied_value)
16
+ fail "Supplied value: #{supplied_value} is not valid. Allowed values are: #{allowed_values.inspect}" unless allowed_values.include?(supplied_value)
17
17
  @value = supplied_value
18
18
  end
19
19
 
@@ -3,7 +3,7 @@ require 'hashie'
3
3
  require_relative './parameter'
4
4
  require_relative './body'
5
5
  require_relative './enum'
6
-
6
+ require 'base64'
7
7
  #
8
8
  # A class to model a request in an expectation.
9
9
  # @author:: Nayyara Samuel (mailto: nayyara.samuel@opower.com)
@@ -17,7 +17,7 @@ module MockServer::Model
17
17
  end
18
18
 
19
19
  # Request model
20
- class Request < Hashie::Dash
20
+ class Request < Hashie::Trash
21
21
  include Hashie::Extensions::MethodAccess
22
22
  include Hashie::Extensions::IgnoreUndeclared
23
23
  include Hashie::Extensions::Coercion
@@ -29,7 +29,11 @@ module MockServer::Model
29
29
  property :query_parameters, default: Parameters.new([])
30
30
  property :cookies, default: Parameters.new([])
31
31
  property :headers, default: Parameters.new([])
32
- property :body
32
+ property :body, transform_with: (lambda do |body|
33
+ is_base_64_body = body && body.type == :BINARY
34
+ body_value = is_base_64_body ? Base64.decode64(body.value) : body.value
35
+ Body.new(type: :STRING, value: body_value)
36
+ end)
33
37
 
34
38
  coerce_key :method, HTTPMethod
35
39
  coerce_key :path, String
@@ -12,6 +12,14 @@ module MockServer::Model
12
12
  def allowed_values
13
13
  [true, false]
14
14
  end
15
+
16
+ def !
17
+ !@value
18
+ end
19
+
20
+ def initialize(supplied_value)
21
+ @value = pre_process_value(supplied_value)
22
+ end
15
23
  end
16
24
 
17
25
  # Model for times class
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  # Version for this gem
3
3
  module MockServer
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.6.pre'
5
5
  end
data/pom.xml CHANGED
@@ -3,7 +3,7 @@
3
3
  <parent>
4
4
  <groupId>org.mock-server</groupId>
5
5
  <artifactId>mockserver</artifactId>
6
- <version>3.9.9-SNAPSHOT</version>
6
+ <version>3.9.17-SNAPSHOT</version>
7
7
  </parent>
8
8
  <modelVersion>4.0.0</modelVersion>
9
9
 
@@ -22,7 +22,7 @@
22
22
  <plugin>
23
23
  <groupId>org.codehaus.mojo</groupId>
24
24
  <artifactId>exec-maven-plugin</artifactId>
25
- <version>1.2.1</version>
25
+ <version>1.4.0</version>
26
26
  <executions>
27
27
  <execution>
28
28
  <id>bundle_install</id>
@@ -56,6 +56,7 @@
56
56
  <argument>exec</argument>
57
57
  <argument>rake</argument>
58
58
  <argument>build</argument>
59
+ <argument>spec</argument>
59
60
  </arguments>
60
61
  <environmentVariables>
61
62
  <BUNDLE_GEMFILE>${basedir}/Gemfile</BUNDLE_GEMFILE>
@@ -47,6 +47,6 @@
47
47
  },
48
48
  "times": {
49
49
  "remainingTimes": 2,
50
- "unlimited": false
50
+ "unlimited": "false"
51
51
  }
52
52
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "times": {
3
3
  "remainingTimes": 1,
4
- "unlimited": false
4
+ "unlimited": "false"
5
5
  }
6
6
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mockserver-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nayyara Samuel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-16 00:00:00.000000000 Z
12
+ date: 2015-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler