beaneater 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
1
  # CHANGELOG for Beaneater
2
2
 
3
- ## 0.2.2 (Unreleased)
3
+ ## 0.2.3 (Unreleased)
4
+
5
+ ## 0.2.2 (Dec 2 2012)
6
+
7
+ * Fixes status and ID parsing in a response (Thanks @justincase)
4
8
 
5
9
  ## 0.2.1 (Dec 1 2012)
6
10
 
@@ -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.scan(/\w+/)
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)
@@ -1,4 +1,4 @@
1
1
  module Beaneater
2
2
  # Current version of gem.
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
@@ -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
@@ -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.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: 2012-12-01 00:00:00.000000000 Z
12
+ date: 2012-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest