cloudprint 0.1.2 → 0.1.3
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.
- data/Gemfile.lock +1 -1
- data/lib/cloudprint/print_job.rb +5 -1
- data/lib/cloudprint/version.rb +1 -1
- data/test/print_job_test.rb +15 -0
- metadata +11 -5
data/Gemfile.lock
CHANGED
data/lib/cloudprint/print_job.rb
CHANGED
@@ -36,6 +36,10 @@ module CloudPrint
|
|
36
36
|
status == "ERROR"
|
37
37
|
end
|
38
38
|
|
39
|
+
def submitted?
|
40
|
+
status == "SUBMITTED"
|
41
|
+
end
|
42
|
+
|
39
43
|
private
|
40
44
|
|
41
45
|
def self.find_by_id(id)
|
@@ -44,4 +48,4 @@ module CloudPrint
|
|
44
48
|
response['jobs'].select{ |job| job['id'] == id }.first
|
45
49
|
end
|
46
50
|
end
|
47
|
-
end
|
51
|
+
end
|
data/lib/cloudprint/version.rb
CHANGED
data/test/print_job_test.rb
CHANGED
@@ -33,6 +33,7 @@ class PrintJobTest < Test::Unit::TestCase
|
|
33
33
|
assert !job.done?
|
34
34
|
assert !job.in_progress?
|
35
35
|
assert !job.error?
|
36
|
+
assert !job.submitted?
|
36
37
|
|
37
38
|
assert job.queued?
|
38
39
|
end
|
@@ -43,6 +44,7 @@ class PrintJobTest < Test::Unit::TestCase
|
|
43
44
|
assert !job.done?
|
44
45
|
assert !job.queued?
|
45
46
|
assert !job.error?
|
47
|
+
assert !job.submitted?
|
46
48
|
|
47
49
|
assert job.in_progress?
|
48
50
|
end
|
@@ -53,6 +55,7 @@ class PrintJobTest < Test::Unit::TestCase
|
|
53
55
|
assert !job.in_progress?
|
54
56
|
assert !job.queued?
|
55
57
|
assert !job.error?
|
58
|
+
assert !job.submitted?
|
56
59
|
|
57
60
|
assert job.done?
|
58
61
|
end
|
@@ -63,10 +66,22 @@ class PrintJobTest < Test::Unit::TestCase
|
|
63
66
|
assert !job.done?
|
64
67
|
assert !job.in_progress?
|
65
68
|
assert !job.queued?
|
69
|
+
assert !job.submitted?
|
66
70
|
|
67
71
|
assert job.error?
|
68
72
|
end
|
69
73
|
|
74
|
+
should "recognize a job as submitted" do
|
75
|
+
job = CloudPrint::PrintJob.new(:status => "SUBMITTED")
|
76
|
+
|
77
|
+
assert !job.done?
|
78
|
+
assert !job.in_progress?
|
79
|
+
assert !job.queued?
|
80
|
+
assert !job.error?
|
81
|
+
|
82
|
+
assert job.submitted?
|
83
|
+
end
|
84
|
+
|
70
85
|
should "refresh a job" do
|
71
86
|
job = CloudPrint::PrintJob.new(:status => "IN_PROGRESS")
|
72
87
|
CloudPrint::PrintJob.stubs(:find_by_id).returns({"id" => "job_id", "status" => "DONE", "errorCode" => "42"})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
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
|
+
date: 2012-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
segments:
|
155
155
|
- 0
|
156
|
-
hash:
|
156
|
+
hash: 2978791594374137830
|
157
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
158
|
none: false
|
159
159
|
requirements:
|
@@ -162,11 +162,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
segments:
|
164
164
|
- 0
|
165
|
-
hash:
|
165
|
+
hash: 2978791594374137830
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project: cloudprint
|
168
168
|
rubygems_version: 1.8.24
|
169
169
|
signing_key:
|
170
170
|
specification_version: 3
|
171
171
|
summary: This library provides a ruby-esque interface to Google Cloud Print.
|
172
|
-
test_files:
|
172
|
+
test_files:
|
173
|
+
- test/cloudprint_test.rb
|
174
|
+
- test/connection_test.rb
|
175
|
+
- test/fixtures/ruby.png
|
176
|
+
- test/helper.rb
|
177
|
+
- test/print_job_test.rb
|
178
|
+
- test/printer_test.rb
|