lbspec 0.2.1 → 0.2.2

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.
@@ -87,7 +87,7 @@ module Lbspec
87
87
  num_patterns, num_match = 0, 0
88
88
  patterns.each do |pat|
89
89
  num_patterns += 1
90
- num_match += 1 if /#{pat}/ =~ string
90
+ num_match += 1 if string.match(pat)
91
91
  end
92
92
  num_match == num_patterns
93
93
  end
@@ -21,7 +21,7 @@ RSpec::Matchers.define :respond do |expect|
21
21
  protocol: @protocol, application: @application,
22
22
  path: @path, options: @options)
23
23
  @output_request = request.send(@string)
24
- @output_request.include?(expect)
24
+ @output_request.match(expect)
25
25
  end
26
26
 
27
27
  chain :tcp do
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  # Lbspec is an RSpec plugin for easy Loadbalancer testing.
3
3
  module Lbspec
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -38,6 +38,11 @@ describe '#respond' do
38
38
  'vhost_a:443/test'.should_not respond('404')
39
39
  .https.from('node_a')
40
40
  end
41
+ it 'should test vhost:443/test does respond /^404/' do
42
+ Lbspec::Util.stub(:exec_command).and_return '404 Not Found'
43
+ 'vhost_a:443/test'.should respond(/^404/)
44
+ .https.from('node_a')
45
+ end
41
46
  end
42
47
  context 'tcp/udp' do
43
48
  it 'should test vhost:25/tcp respond 220' do
@@ -47,7 +52,7 @@ describe '#respond' do
47
52
  end
48
53
  it 'should test vhost:53/udp respond ' do
49
54
  Lbspec::Util.stub(:exec_command).and_return '220'
50
- 'vhost_a:25'.should respond('220')
55
+ 'vhost_a:53'.should respond('220')
51
56
  .udp.with('HELO test.example.com')
52
57
  end
53
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lbspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-01 00:00:00.000000000 Z
12
+ date: 2014-04-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -188,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  segments:
190
190
  - 0
191
- hash: -4421484859760496342
191
+ hash: 677344431770284692
192
192
  required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  segments:
199
199
  - 0
200
- hash: -4421484859760496342
200
+ hash: 677344431770284692
201
201
  requirements: []
202
202
  rubyforge_project:
203
203
  rubygems_version: 1.8.21