wicoris-postman 0.11.3 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require 'cabin'
2
2
  require 'json'
3
3
  require 'mixlib/cli'
4
+ require 'mixlib/shellout'
4
5
  require 'mixlib/config'
5
6
  require 'jlo'
6
7
  require 'wicoris/postman/version'
@@ -18,7 +18,7 @@ module Wicoris
18
18
 
19
19
  # Actually fax the letter.
20
20
  def run
21
- system(command) unless @opts[:noop]
21
+ Mixlib::ShellOut.new(command).run_command unless @opts[:noop]
22
22
  logger.debug :message => 'Letter faxed',
23
23
  :phone => validated_phone,
24
24
  :letter => @job.letter,
@@ -1,5 +1,5 @@
1
1
  module Wicoris
2
2
  module Postman
3
- VERSION = '0.11.3'
3
+ VERSION = '0.12.0'
4
4
  end
5
5
  end
@@ -4,9 +4,10 @@ module Wicoris::Postman
4
4
  describe FaxMachine do
5
5
  let(:job) { double('job') }
6
6
  let(:fax) { FaxMachine.new(job) }
7
+ let(:shellout) { double('shellout').as_null_object }
7
8
 
8
9
  before do
9
- fax.stub(:system)
10
+ Mixlib::ShellOut.stub(:new).and_return(shellout)
10
11
  end
11
12
 
12
13
  describe '#run' do
@@ -21,7 +22,9 @@ module Wicoris::Postman
21
22
 
22
23
  it 'faxes the document' do
23
24
  fax.stub(:command).and_return('chunky bacon')
24
- fax.should_receive(:system).with('chunky bacon')
25
+ cmd = double('cmd')
26
+ cmd.should_receive(:run_command)
27
+ Mixlib::ShellOut.should_receive(:new).with('chunky bacon').and_return(cmd)
25
28
  fax.run
26
29
  end
27
30
 
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "cabin", "~> 0.6"
23
23
  spec.add_dependency "mixlib-cli", "~> 1.4"
24
24
  spec.add_dependency "mixlib-config", "~> 2.1"
25
+ spec.add_dependency "mixlib-shellout", "~> 1.3"
25
26
  spec.add_dependency "jlo", "~> 0.4"
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wicoris-postman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 11
9
- - 3
10
- version: 0.11.3
8
+ - 12
9
+ - 0
10
+ version: 0.12.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Bjo\xCC\x88rn Albers"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-03-13 00:00:00 +01:00
18
+ date: 2014-03-14 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -80,6 +80,21 @@ dependencies:
80
80
  name: mixlib-config
81
81
  - !ruby/object:Gem::Dependency
82
82
  version_requirements: &id005 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ hash: 9
88
+ segments:
89
+ - 1
90
+ - 3
91
+ version: "1.3"
92
+ prerelease: false
93
+ requirement: *id005
94
+ type: :runtime
95
+ name: mixlib-shellout
96
+ - !ruby/object:Gem::Dependency
97
+ version_requirements: &id006 !ruby/object:Gem::Requirement
83
98
  none: false
84
99
  requirements:
85
100
  - - ~>
@@ -90,11 +105,11 @@ dependencies:
90
105
  - 4
91
106
  version: "0.4"
92
107
  prerelease: false
93
- requirement: *id005
108
+ requirement: *id006
94
109
  type: :runtime
95
110
  name: jlo
96
111
  - !ruby/object:Gem::Dependency
97
- version_requirements: &id006 !ruby/object:Gem::Requirement
112
+ version_requirements: &id007 !ruby/object:Gem::Requirement
98
113
  none: false
99
114
  requirements:
100
115
  - - ~>
@@ -105,11 +120,11 @@ dependencies:
105
120
  - 3
106
121
  version: "1.3"
107
122
  prerelease: false
108
- requirement: *id006
123
+ requirement: *id007
109
124
  type: :development
110
125
  name: bundler
111
126
  - !ruby/object:Gem::Dependency
112
- version_requirements: &id007 !ruby/object:Gem::Requirement
127
+ version_requirements: &id008 !ruby/object:Gem::Requirement
113
128
  none: false
114
129
  requirements:
115
130
  - - ">="
@@ -119,11 +134,11 @@ dependencies:
119
134
  - 0
120
135
  version: "0"
121
136
  prerelease: false
122
- requirement: *id007
137
+ requirement: *id008
123
138
  type: :development
124
139
  name: rake
125
140
  - !ruby/object:Gem::Dependency
126
- version_requirements: &id008 !ruby/object:Gem::Requirement
141
+ version_requirements: &id009 !ruby/object:Gem::Requirement
127
142
  none: false
128
143
  requirements:
129
144
  - - ~>
@@ -134,11 +149,11 @@ dependencies:
134
149
  - 5
135
150
  version: "0.5"
136
151
  prerelease: false
137
- requirement: *id008
152
+ requirement: *id009
138
153
  type: :development
139
154
  name: aruba
140
155
  - !ruby/object:Gem::Dependency
141
- version_requirements: &id009 !ruby/object:Gem::Requirement
156
+ version_requirements: &id010 !ruby/object:Gem::Requirement
142
157
  none: false
143
158
  requirements:
144
159
  - - ~>
@@ -149,7 +164,7 @@ dependencies:
149
164
  - 2
150
165
  version: "1.2"
151
166
  prerelease: false
152
- requirement: *id009
167
+ requirement: *id010
153
168
  type: :development
154
169
  name: aruba-doubles
155
170
  description: Deliver letters from WiCoRIS
@@ -223,7 +238,7 @@ rubyforge_project:
223
238
  rubygems_version: 1.6.2
224
239
  signing_key:
225
240
  specification_version: 3
226
- summary: wicoris-postman-0.11.3
241
+ summary: wicoris-postman-0.12.0
227
242
  test_files:
228
243
  - features/copy.feature
229
244
  - features/fax.feature