beaneater 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -1
- data/lib/beaneater/connection.rb +1 -1
- data/lib/beaneater/version.rb +1 -1
- data/test/connection_test.rb +7 -0
- data/test/tubes_test.rb +6 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/beaneater/connection.rb
CHANGED
@@ -111,7 +111,7 @@ module Beaneater
|
|
111
111
|
def parse_response(cmd, res)
|
112
112
|
res_lines = res.split(/\r?\n/)
|
113
113
|
status = res_lines.first
|
114
|
-
status, id = status.
|
114
|
+
status, id = status.split(/\s/)
|
115
115
|
raise UnexpectedResponse.from_status(status, cmd) if UnexpectedResponse::ERROR_STATES.include?(status)
|
116
116
|
raw_body = res_lines[1..-1].join("\n")
|
117
117
|
body = ['FOUND', 'RESERVED'].include?(status) ? config.job_parser.call(raw_body) : YAML.load(raw_body)
|
data/lib/beaneater/version.rb
CHANGED
data/test/connection_test.rb
CHANGED
@@ -46,6 +46,13 @@ describe Beaneater::Connection do
|
|
46
46
|
assert_equal '254', res[:id]
|
47
47
|
assert_equal 'INSERTED', res[:status]
|
48
48
|
end
|
49
|
+
|
50
|
+
it "should support dashes in response" do
|
51
|
+
Net::Telnet.any_instance.expects(:cmd).with(has_entries('String' => 'bar')).returns('USING foo-bar')
|
52
|
+
res = @bc.transmit 'bar'
|
53
|
+
assert_equal 'USING', res[:status]
|
54
|
+
assert_equal 'foo-bar', res[:id]
|
55
|
+
end
|
49
56
|
end # transmit
|
50
57
|
|
51
58
|
describe 'for #close' do
|
data/test/tubes_test.rb
CHANGED
@@ -68,7 +68,12 @@ describe Beaneater::Tubes do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'should retrieve used tube' do
|
71
|
-
assert_equal'bar', @pool.tubes.used.name
|
71
|
+
assert_equal 'bar', @pool.tubes.used.name
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should support dashed tubes' do
|
75
|
+
@pool.tubes.find('der-bam').put 'foo'
|
76
|
+
assert_equal 'der-bam', @pool.tubes.used.name
|
72
77
|
end
|
73
78
|
end # used
|
74
79
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaneater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
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: 2012-12-
|
12
|
+
date: 2012-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|