lis 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,12 +60,12 @@ end
60
60
 
61
61
  Then /^LIS should have sent test orders to client:$/ do |text|
62
62
  @data = @client.read_all
63
- @data.force_encoding("ASCII-8BIT") if @data.respond_to?(:force_encoding)
64
- @packets = @data.split("\002").select { |s| s =~ /^\d[A-Z]/n }
63
+ @data.force_encoding("utf-8") if @data.respond_to?(:force_encoding)
64
+ @packets = @data.split("\002").select { |s| s =~ /^\d[A-Z]/ }
65
65
  @packets.zip(text.split(/\n/)) do |actual, expected|
66
66
  @called = true
67
- rx = Regexp.new("^" + Regexp.escape(expected.strip.force_encoding('ASCII-8BIT')), Regexp::NOENCODING)
68
- assert_match(rx, actual.gsub(/\r\003.*$/n, "").strip)
67
+ rx = Regexp.new("^" + Regexp.escape(expected.strip))
68
+ assert_match(rx, actual.gsub(/\r\003.*$/, "").strip)
69
69
  end
70
70
  assert_equal(true, @called)
71
71
  end
@@ -32,7 +32,7 @@ module LIS::Transfer
32
32
  # | `------------------ message
33
33
  # `---------------------- frame number
34
34
  )
35
- /xmn
35
+ /xm
36
36
 
37
37
  def initialize(*args)
38
38
  super(*args)
data/lib/lis/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module LIS
4
- VERSION = "0.4.9"
4
+ VERSION = "0.4.10"
5
5
  end
6
6
 
@@ -74,7 +74,7 @@ class TestPacketizedProtocol < Test::Unit::TestCase
74
74
  end
75
75
 
76
76
  should "propagate only packet data" do
77
- @str = "\0023L|1\r\0033C\r\n".force_encoding("ASCII-8BIT")
77
+ @str = "\0023L|1\r\0033C\r\n"
78
78
  @protocol.receive("\005")
79
79
  @protocol.receive(@str)
80
80
  @protocol.receive("\004")
@@ -1,12 +1,10 @@
1
- # encoding: utf-8
2
-
3
1
  require 'helper'
4
2
 
5
3
  class TestMessages < Test::Unit::TestCase
6
4
 
7
5
  context "parsing an order message" do
8
6
  setup do
9
- @str = "O|1|8780||^^^ATA|R|||||||||||||||||||B0135".force_encoding("ASCII-8BIT")
7
+ @str = "O|1|8780||^^^ATA|R|||||||||||||||||||B0135"
10
8
  @message = LIS::Message::Base.from_string(@str)
11
9
  end
12
10
 
@@ -26,7 +24,7 @@ class TestMessages < Test::Unit::TestCase
26
24
 
27
25
  context "parsing a comment message" do
28
26
  setup do
29
- @str = "C|1|BAD_QC|".force_encoding("ASCII-8BIT")
27
+ @str = "C|1|BAD_QC|"
30
28
  @message = LIS::Message::Base.from_string(@str)
31
29
  end
32
30
 
@@ -35,26 +33,9 @@ class TestMessages < Test::Unit::TestCase
35
33
  end
36
34
  end
37
35
 
38
- context "parsing a patient message" do
39
- setup do
40
- @str = "P|1|123||123|Müller^Ulrich Peter||||||||".force_encoding("ASCII-8BIT")
41
- @message = LIS::Message::Base.from_string(@str)
42
- end
43
-
44
- should "have correct type" do
45
- assert_equal LIS::Message::Patient, @message.class
46
- assert_equal "P", @message.type_id
47
- end
48
-
49
- should "have correct name" do
50
- assert_equal "Müller^Ulrich Peter".force_encoding("ASCII-8BIT"), @message.name # FIXME, this should be utf8
51
- end
52
-
53
- end
54
-
55
36
  context "parsing a result message" do
56
37
  setup do
57
- @str = "R|1|^^^TSH|0.902|mIU/L|0.400\\0.004^4.00\\75.0|N|N|R|||20100115105636|20100115120641|B0135".force_encoding("ASCII-8BIT")
38
+ @str = "R|1|^^^TSH|0.902|mIU/L|0.400\\0.004^4.00\\75.0|N|N|R|||20100115105636|20100115120641|B0135"
58
39
  @message = LIS::Message::Base.from_string(@str)
59
40
  end
60
41
 
@@ -84,7 +65,7 @@ class TestMessages < Test::Unit::TestCase
84
65
  end
85
66
 
86
67
  should "parse empty result messages without error" do
87
- @message = LIS::Message::Base.from_string("R|1|^^^||||||X|||||LIAISON".force_encoding("ASCII-8BIT"))
68
+ @message = LIS::Message::Base.from_string("R|1|^^^||||||X|||||LIAISON")
88
69
  assert_equal LIS::Message::Result, @message.class
89
70
  end
90
71
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
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: 2013-04-22 00:00:00.000000000 Z
12
+ date: 2013-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: packet_io