extface 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,12 +47,55 @@ module Extface
47
47
  end
48
48
 
49
49
  test "fsend" do
50
+ job = extface_jobs(:one)
50
51
  job_thread = Thread.new do
51
- @driver.set_job(extface_jobs(:one))
52
+ @driver.set_job(job)
52
53
  result = @driver.fsend(0x2C) # paper move command
53
54
  end
55
+ simulate_device_pull(job)
56
+ @driver.handle("\x01\x2C\x2F\x2D\x50\x04\x88\x80\xC0\x80\x80\xB0\x05\x30\x34\x35\x39\x03".b)
57
+ simulate_device_pull(job)
54
58
  @driver.handle("\x01\x2C\x2F\x2D\x50\x04\x88\x80\xC0\x80\x80\xB0\x05\x30\x34\x35\x39\x03".b)
55
59
  job_thread.join
60
+ assert @driver.errors.empty?
56
61
  end
57
62
  end
58
63
  end
64
+
65
+ =begin
66
+ 1432096828.834384 "del" "extface:d29183a38460cc33dfdfc2a38c20eb7d"
67
+ 1432096828.835035 "del" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5"
68
+ 1432096828.912680 "subscribe" "extface:354"
69
+ 1432096828.916584 "rpush" "extface:354" "\x01% JX\x0500><\x03"
70
+ 1432096834.022511 "blpop" "extface:354" "1"
71
+ 1432096834.025004 "publish" "extface:354" "OK"
72
+ 1432096834.025467 "unsubscribe"
73
+ 1432096834.025726 "blpop" "extface:354" "1"
74
+ 1432096834.026166 "publish" "extface:354" "OK"
75
+ 1432096834.026509 "blpop" "extface:354" "1"
76
+ 1432096834.122677 "publish" "extface:354" "Job 354 device connected!"
77
+ 1432096834.124782 "blpop" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5" "3"
78
+ 1432096834.155940 "append" "extface:d29183a38460cc33dfdfc2a38c20eb7d" "\x01+ J\x04\x80\x80\x92\x8f\x80\xb2\x0503?1\x03"
79
+ 1432096834.255090 "get" "extface:d29183a38460cc33dfdfc2a38c20eb7d"
80
+ 1432096834.259587 "rpush" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5" "\x01+ J\x04\x80\x80\x92\x8f\x80\xb2\x0503?1\x03"
81
+ 1432096834.261451 "set" "extface:d29183a38460cc33dfdfc2a38c20eb7d" ""
82
+ 1432096834.287925 "subscribe" "extface:354"
83
+ 1432096834.288641 "rpush" "extface:354" "\x01$!-\x050077\x03"
84
+ 1432096834.289568 "publish" "extface:354" "OK"
85
+ 1432096834.289927 "blpop" "extface:354" "1"
86
+ 1432096834.290075 "unsubscribe"
87
+ 1432096834.303192 "publish" "extface:354" "Job 354 completed!"
88
+ 1432096834.381481 "append" "extface:d29183a38460cc33dfdfc2a38c20eb7d" "\x16"
89
+ 1432096834.381674 "get" "extface:d29183a38460cc33dfdfc2a38c20eb7d"
90
+ 1432096834.384880 "rpush" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5" "\x16"
91
+ 1432096834.385729 "set" "extface:d29183a38460cc33dfdfc2a38c20eb7d" ""
92
+ 1432096834.695593 "append" "extface:d29183a38460cc33dfdfc2a38c20eb7d" "\x16"
93
+ 1432096834.696066 "get" "extface:d29183a38460cc33dfdfc2a38c20eb7d"
94
+ 1432096834.721265 "rpush" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5" "\x16"
95
+ 1432096834.722383 "set" "extface:d29183a38460cc33dfdfc2a38c20eb7d" ""
96
+ 1432096835.041215 "append" "extface:d29183a38460cc33dfdfc2a38c20eb7d" "\x16\x16\x16\x16\x01,!-F\x04\x80\x80\x92\x8f\x80\xb2\x05041<\x03"
97
+ 1432096835.041828 "get" "extface:d29183a38460cc33dfdfc2a38c20eb7d"
98
+ 1432096835.073717 "rpush" "extface:d29183a38460cc33dfdfc2a38c20eb7d:5" "\x16"
99
+ 1432096835.075013 "set" "extface:d29183a38460cc33dfdfc2a38c20eb7d" "\x16\x16\x16\x01,!-F\x04\x80\x80\x92\x8f\x80\xb2\x05041<\x03"
100
+
101
+ =end
data/test/test_helper.rb CHANGED
@@ -19,6 +19,10 @@ class ActiveSupport::TestCase
19
19
  load "#{Rails.root}/db/schema.rb"
20
20
 
21
21
  fixtures :all
22
+
23
+ def simulate_device_pull(job)
24
+ Extface.redis_block{ |r| sleep 1; r.publish(job.id, "OK") } #simulate send to device
25
+ end
22
26
  end
23
27
  module Extface
24
28
  class ActionController::TestCase
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails