wiremock_mapper 0.6.0 → 0.7.0

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: 9f120074815585f809be94a0c688f74dab08a525
4
- data.tar.gz: 3aa65a0f6e7f0b48b68093a4d424dd694447cbf1
3
+ metadata.gz: f8ae7fc5b24332ff8f6cf752b9a1b30944080e3f
4
+ data.tar.gz: cc69e9a04da8e7883b3af48b79eaee56b5cf115b
5
5
  SHA512:
6
- metadata.gz: 1cc94dd1aa580de748d23ff5231cfd612a950b0134cb9d6714e0a070670766e7a3aaff11f384ee712ef9e3dc763d2598cc070b54b09b67364bbbcc2a3c923541
7
- data.tar.gz: 876d7d72b05cdd6c15a5da27ff9e1a55e5bfe2df554b0e1541afb70a1c4d4c82ebfff2a76ec466a031b9e8c278ba5618df42ef920c8629e265df7be7b28cb3d7
6
+ metadata.gz: 34f6165b49809071f1437bab5dd1b818131bd3cd2bf245b0370216ad9a09649d5f87a043e586f41136a3e7c93c1d908c840ec17d8dd48ed5790a28b5ecc4db8a
7
+ data.tar.gz: 9f354bb62c1c16337c17e5354304d3619364452ebf47d94940d1c9015019e836ac990d64aef019ff3aadd03600cb7e7f2df90439ae039856580147ad0a901e4a
data/README.md CHANGED
@@ -19,7 +19,7 @@ WireMockMapper::Configuration.create_global_mapping do |request, respond|
19
19
  end
20
20
 
21
21
  WireMockMapper.create_mapping do |request, respond|
22
- request.receives_post
22
+ request.is_a_post
23
23
  .with_url_path.equal_to('path/to/stub')
24
24
  .with_header('Some-Other-Header').equal_to('some_other_value')
25
25
  .with_cookie('Some-Other-Cookie').equal_to('some_other_cookie_value')
@@ -9,49 +9,49 @@ module WireMockMapper
9
9
  end
10
10
 
11
11
  ##
12
- # @!method receives_any
12
+ # @!method is_a_any
13
13
  # Sets the request HTTP method to ANY
14
14
  # @return [RequestBuilder] request builder for chaining
15
15
 
16
16
  ##
17
- # @!method receives_delete
17
+ # @!method is_a_delete
18
18
  # Sets the request HTTP method to DELETE
19
19
  # @return [RequestBuilder] request builder for chaining
20
20
 
21
21
  ##
22
- # @!method receives_get
22
+ # @!method is_a_get
23
23
  # Sets the request HTTP method to GET
24
24
  # @return [RequestBuilder] request builder for chaining
25
25
 
26
26
  ##
27
- # @!method receives_head
27
+ # @!method is_a_head
28
28
  # Sets the request HTTP method to HEAD
29
29
  # @return [RequestBuilder] request builder for chaining
30
30
 
31
31
  ##
32
- # @!method receives_options
32
+ # @!method is_a_options
33
33
  # Sets the request HTTP method to OPTIONS
34
34
  # @return [RequestBuilder] request builder for chaining
35
35
 
36
36
  ##
37
- # @!method receives_post
37
+ # @!method is_a_post
38
38
  # Sets the request HTTP method to POST
39
39
  # @return [RequestBuilder] request builder for chaining
40
40
 
41
41
  ##
42
- # @!method receives_put
42
+ # @!method is_a_put
43
43
  # Sets the request HTTP method to PUT
44
44
  # @return [RequestBuilder] request builder for chaining
45
45
 
46
46
  ##
47
- # @!method receives_trace
47
+ # @!method is_a_trace
48
48
  # Sets the request HTTP method to TRACE
49
49
  # @return [RequestBuilder] request builder for chaining
50
50
  HTTP_VERBS = %w(ANY DELETE GET HEAD OPTIONS POST PUT TRACE).freeze
51
51
  private_constant :HTTP_VERBS
52
52
 
53
53
  HTTP_VERBS.each do |verb|
54
- define_method("receives_#{verb.downcase}") do
54
+ define_method("is_a_#{verb.downcase}") do
55
55
  @options[:method] = verb
56
56
  self
57
57
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module WireMockMapper
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
@@ -3,65 +3,65 @@ require 'spec_helper'
3
3
  describe WireMockMapper::Builders::RequestBuilder do
4
4
  let(:builder) { WireMockMapper::Builders::RequestBuilder.new }
5
5
 
6
- describe 'receives_any' do
6
+ describe 'is_a_any' do
7
7
  it 'sets the http method and url path' do
8
- builder.receives_any
8
+ builder.is_a_any
9
9
  result = builder.to_hash
10
10
  expect(result[:method]).to eq('ANY')
11
11
  end
12
12
  end
13
13
 
14
- describe 'receives_delete' do
14
+ describe 'is_a_delete' do
15
15
  it 'sets the http method and url path' do
16
- builder.receives_delete
16
+ builder.is_a_delete
17
17
  result = builder.to_hash
18
18
  expect(result[:method]).to eq('DELETE')
19
19
  end
20
20
  end
21
21
 
22
- describe 'receives_get' do
22
+ describe 'is_a_get' do
23
23
  it 'sets the http method and url path' do
24
- builder.receives_get
24
+ builder.is_a_get
25
25
  result = builder.to_hash
26
26
  expect(result[:method]).to eq('GET')
27
27
  end
28
28
  end
29
29
 
30
- describe 'receives_head' do
30
+ describe 'is_a_head' do
31
31
  it 'sets the http method and url path' do
32
- builder.receives_head
32
+ builder.is_a_head
33
33
  result = builder.to_hash
34
34
  expect(result[:method]).to eq('HEAD')
35
35
  end
36
36
  end
37
37
 
38
- describe 'receives_options' do
38
+ describe 'is_a_options' do
39
39
  it 'sets the http method and url path' do
40
- builder.receives_options
40
+ builder.is_a_options
41
41
  result = builder.to_hash
42
42
  expect(result[:method]).to eq('OPTIONS')
43
43
  end
44
44
  end
45
45
 
46
- describe 'receives_put' do
46
+ describe 'is_a_put' do
47
47
  it 'sets the http method and url path' do
48
- builder.receives_put
48
+ builder.is_a_put
49
49
  result = builder.to_hash
50
50
  expect(result[:method]).to eq('PUT')
51
51
  end
52
52
  end
53
53
 
54
- describe 'receives_post' do
54
+ describe 'is_a_post' do
55
55
  it 'sets the http method and url path' do
56
- builder.receives_post
56
+ builder.is_a_post
57
57
  result = builder.to_hash
58
58
  expect(result[:method]).to eq('POST')
59
59
  end
60
60
  end
61
61
 
62
- describe 'receives_trace' do
62
+ describe 'is_a_trace' do
63
63
  it 'sets the http method and url path' do
64
- builder.receives_trace
64
+ builder.is_a_trace
65
65
  result = builder.to_hash
66
66
  expect(result[:method]).to eq('TRACE')
67
67
  end
@@ -14,7 +14,7 @@ describe WireMockMapper do
14
14
  stub_request(:post, "#{url}/__admin/mappings/new").with(body: expected_request_body)
15
15
 
16
16
  WireMockMapper.create_mapping(url) do |request, respond|
17
- request.receives_post
17
+ request.is_a_post
18
18
  .with_url_path.equal_to('/some/path')
19
19
  .with_header('some_header').equal_to('some header value')
20
20
  .with_body.matching('some request body')
@@ -40,7 +40,7 @@ describe WireMockMapper do
40
40
  expect(WireMockMapper::Configuration).to receive(:request_builder).and_return(request_builder)
41
41
 
42
42
  WireMockMapper.create_mapping(url) do |request, respond|
43
- request.receives_post
43
+ request.is_a_post
44
44
  .with_url.equal_to('/some/url')
45
45
  .with_header('some_header').equal_to('some header value')
46
46
  .with_body.matching('some request body')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wiremock_mapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Datlof