mulder 0.2.1 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 859d33d9fff0b6499c90530e69a148b2d40ec0a6
4
- data.tar.gz: c4f722ad1f2cb0940d2a5473159457ddf7b46e32
3
+ metadata.gz: bb924012ddd6660fb1324aaa9a774f9b395199f6
4
+ data.tar.gz: a021f1092d305af2512e6de228cafc8a6caf7842
5
5
  SHA512:
6
- metadata.gz: 39a6eec52a45f0e3e83d7ff45200b2a7c5a1d5379424aeb9db0467b42060f9004f564f7fd4916c3a619f27634d7fdade4b8269943e38852d43c8bd8d9a5faacb
7
- data.tar.gz: 7831ee1ca49fc5bbebd31f57d93b954acd1ae51d7fd856e52b28c3a5f65bf0d86af9836a131f14a55aeded1a3497694253a4ddf8b93c153b02df570a91215b0e
6
+ metadata.gz: 9de11ada5bbd69241eaed4d593b385a13e5da0393b96476ee00ea115ceae987f5e6cc2a405d3b073b895d555c130de5a03904eb18e93835723fa87a032cc23e1
7
+ data.tar.gz: 400042dafe5c63253f33a2d3062501567bccfd1a2a9cc4ba6f88693586fd97bf44b1fecc842f0c4c35b2c470e1fc289cec7e7b624c14984a0eeb27fbec644d0c
@@ -19,7 +19,7 @@ module Mulder
19
19
  end
20
20
 
21
21
  def id_regexp
22
- /^.*-?#{@app}-#{@environment}-(.*-)?#{@role}-.*$/i
22
+ /^#{@app}-#{@environment}-(.*-)?#{@role}-.*$/i
23
23
  end
24
24
 
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module Mulder
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -17,7 +17,7 @@ describe Mulder::Client do
17
17
  describe '#group' do
18
18
  it 'finds the correct group based on the given attributes' do
19
19
  mocked_connection = mock
20
- mocked_connection.expects(:group_by_id_regexp).with(/^.*-?foo-bar-(.*-)?WorkerGroup-.*$/i)
20
+ mocked_connection.expects(:group_by_id_regexp).with(/^foo-bar-(.*-)?WorkerGroup-.*$/i)
21
21
  client = described_class.new(mocked_connection, 'foo', 'bar', 'WorkerGroup')
22
22
 
23
23
  client.group
@@ -47,9 +47,28 @@ describe Mulder::Client do
47
47
  'foo-bar-abc123-worker-3'.should match(client.id_regexp)
48
48
  end
49
49
 
50
- it 'matches with a prefixed id' do
51
- client = described_class.new(mock, 'foo', 'bar', 'worker')
52
- 'widget-foo-bar-abd123-worker-8'.should match(client.id_regexp)
50
+ context 'with prefixed id' do
51
+ let(:client) { described_class.new(mock, 'widget-foo', 'bar', 'worker') }
52
+
53
+ it 'matches the prefixed group' do
54
+ 'widget-foo-bar-abd123-worker-8'.should match(client.id_regexp)
55
+ end
56
+
57
+ it 'does not match the non-prefixed group' do
58
+ 'foo-bar-derp456-worker-99'.should_not match(client.id_regexp)
59
+ end
60
+ end
61
+
62
+ context 'with non-prefixed id' do
63
+ let(:client) { described_class.new(mock, 'foo', 'bar', 'worker') }
64
+
65
+ it 'does not match the prefixed group' do
66
+ 'widget-foo-bar-abd123-worker-8'.should_not match(client.id_regexp)
67
+ end
68
+
69
+ it 'matches the non-prefixed group' do
70
+ 'foo-bar-derp456-worker-99'.should match(client.id_regexp)
71
+ end
53
72
  end
54
73
  end
55
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mulder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duncan Grazier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-22 00:00:00.000000000 Z
11
+ date: 2014-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler