scmd 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +2 -0
- data/lib/scmd/command_spy.rb +3 -3
- data/lib/scmd/version.rb +1 -1
- data/scmd.gemspec +2 -2
- data/test/unit/command_spy_tests.rb +16 -0
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 5e48e0e6abec09c2d488171bf2ffd04031b7efbe
|
4
|
-
data.tar.gz: f359070c4b73bb593beeeef403bfc14646bf5cce
|
5
2
|
SHA512:
|
6
|
-
|
7
|
-
|
3
|
+
data.tar.gz: ed9ca292a7ab5bacd4b612125296145d99fd3d20b1d4c3c55fc3da46a11426211ceac1f8f6972297c03ed22e423a95217c82d32b7e964360336c728cad0c8c4d
|
4
|
+
metadata.gz: ad853af953c41c5abffd384004a4859a5257ed7aaaaf9bcc7f63a23b7a672814f8b96133bdcd567607217c86ee2a6627552a83a91961a4a9fde65d09fc8d5fb0
|
5
|
+
SHA1:
|
6
|
+
data.tar.gz: 09b25fe5cd8e3be7e5612292c988ca45fde59368
|
7
|
+
metadata.gz: d0c86ff35195eeef15b79dc55e82bb8966d7506b
|
data/Gemfile
CHANGED
data/lib/scmd/command_spy.rb
CHANGED
@@ -25,7 +25,7 @@ module Scmd
|
|
25
25
|
|
26
26
|
def run(input = nil)
|
27
27
|
@run_calls.push(InputCall.new(input))
|
28
|
-
Scmd.calls.push(Scmd::Call.new(self, input))
|
28
|
+
Scmd.calls.push(Scmd::Call.new(self, input)) if ENV['SCMD_TEST_MODE']
|
29
29
|
self
|
30
30
|
end
|
31
31
|
|
@@ -35,7 +35,7 @@ module Scmd
|
|
35
35
|
|
36
36
|
def run!(input = nil)
|
37
37
|
@run_bang_calls.push(InputCall.new(input))
|
38
|
-
Scmd.calls.push(Scmd::Call.new(self, input))
|
38
|
+
Scmd.calls.push(Scmd::Call.new(self, input)) if ENV['SCMD_TEST_MODE']
|
39
39
|
self
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ module Scmd
|
|
45
45
|
|
46
46
|
def start(input = nil)
|
47
47
|
@start_calls.push(InputCall.new(input))
|
48
|
-
Scmd.calls.push(Scmd::Call.new(self, input))
|
48
|
+
Scmd.calls.push(Scmd::Call.new(self, input)) if ENV['SCMD_TEST_MODE']
|
49
49
|
@running = true
|
50
50
|
end
|
51
51
|
|
data/lib/scmd/version.rb
CHANGED
data/scmd.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "scmd/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "scmd"
|
8
|
-
gem.version =
|
8
|
+
gem.version = Scmd::VERSION
|
9
9
|
gem.authors = ["Kelly Redding", "Collin Redding"]
|
10
10
|
gem.email = ["kelly@kellyredding.com", "collin.redding@me.com"]
|
11
11
|
gem.summary = %q{Build and run system commands.}
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_development_dependency("assert", ["~> 2.16.
|
21
|
+
gem.add_development_dependency("assert", ["~> 2.16.2"])
|
22
22
|
|
23
23
|
gem.add_dependency("posix-spawn", ["~> 0.3.11"])
|
24
24
|
|
@@ -161,6 +161,22 @@ class Scmd::CommandSpy
|
|
161
161
|
assert_equal 2, Scmd.calls.size
|
162
162
|
end
|
163
163
|
|
164
|
+
should "not track global run, run! or start calls if not in test mode" do
|
165
|
+
ENV.delete('SCMD_TEST_MODE')
|
166
|
+
|
167
|
+
input = Factory.string
|
168
|
+
# if `Scmd.calls` is called when not in test mode it will raise an error,
|
169
|
+
# so if no error is raised then it didn't try to add the call
|
170
|
+
assert_raises(NoMethodError){ Scmd.calls }
|
171
|
+
assert_nothing_raised do
|
172
|
+
subject.run(input)
|
173
|
+
subject.run!(input)
|
174
|
+
subject.start(input)
|
175
|
+
end
|
176
|
+
|
177
|
+
ENV['SCMD_TEST_MODE'] = '1'
|
178
|
+
end
|
179
|
+
|
164
180
|
should "track its wait calls" do
|
165
181
|
timeout = Factory.string
|
166
182
|
subject.wait(timeout)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Redding
|
@@ -10,28 +10,28 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-08-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
|
17
|
-
prerelease: false
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
22
|
-
version: 2.16.
|
20
|
+
version: 2.16.2
|
23
21
|
type: :development
|
24
|
-
|
25
|
-
|
26
|
-
name: posix-spawn
|
22
|
+
requirement: *id001
|
23
|
+
name: assert
|
27
24
|
prerelease: false
|
28
|
-
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
29
27
|
requirements:
|
30
28
|
- - ~>
|
31
29
|
- !ruby/object:Gem::Version
|
32
30
|
version: 0.3.11
|
33
31
|
type: :runtime
|
34
|
-
|
32
|
+
requirement: *id002
|
33
|
+
name: posix-spawn
|
34
|
+
prerelease: false
|
35
35
|
description: Build and run system commands.
|
36
36
|
email:
|
37
37
|
- kelly@kellyredding.com
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
requirements: []
|
90
90
|
|
91
91
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.5.1
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Build and run system commands.
|