lowered-expectations 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYRIGHT +1 -0
- data/RELEASENOTES.md +4 -0
- data/lib/lowered/expectations.rb +2 -1
- data/lowered-expectations.gemspec +1 -1
- data/spec/integration/lowered/expectations_integration_spec.rb +22 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f17c84deb4d08951a3eaba2467b6eb565adc9736
|
4
|
+
data.tar.gz: febd20b442c3b8fae728ef969951f9264df23289
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e8e70bf8c64473fdd8b524aeec08e6035304ed43c0e04d3dc618f9ac2faef43ae41488dbd4ed67af583388125c770c2b55e5c95ca52131bbf10d0fbd8d267ec
|
7
|
+
data.tar.gz: 1eb2eeb5f8ba99a4932907815503f3cc5b97d20e79afab708a4adf245ae980688c2800a17d609c124f7be417275d1d60dd6685ae06944c2210acf5f2d486e237
|
data/COPYRIGHT
CHANGED
data/RELEASENOTES.md
CHANGED
data/lib/lowered/expectations.rb
CHANGED
@@ -4,7 +4,7 @@ require 'shellwords'
|
|
4
4
|
require 'pty'
|
5
5
|
|
6
6
|
class LoweredExpectations
|
7
|
-
VERSION = '1.0.
|
7
|
+
VERSION = '1.0.3'.freeze
|
8
8
|
|
9
9
|
class VersionPatternError < StandardError
|
10
10
|
end
|
@@ -48,6 +48,7 @@ class LoweredExpectations
|
|
48
48
|
if quiet
|
49
49
|
# Run without streaming std* to any screen
|
50
50
|
stdout, stderr, status = Open3.capture3(cmd)
|
51
|
+
status = status.exitstatus
|
51
52
|
else
|
52
53
|
# Run but stream as well as capture stdout to the screen
|
53
54
|
status = pty(cmd) do |r,w,pid|
|
@@ -5,7 +5,7 @@ require 'lowered/expectations'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "lowered-expectations"
|
7
7
|
spec.version = LoweredExpectations::VERSION
|
8
|
-
spec.authors = ["Ian Chesal", "Derek Tamsen"]
|
8
|
+
spec.authors = ["Ian Chesal", "Derek Tamsen", "Grier Johnson"]
|
9
9
|
spec.email = ["ian.chesal@gmail.com"]
|
10
10
|
spec.summary = 'A library for testing versions of command line tools.'
|
11
11
|
spec.description = <<-END
|
@@ -26,4 +26,26 @@ RSpec.describe LoweredExpectations do
|
|
26
26
|
expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error(LoweredExpectations::MissingExecutableError)
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
describe '.run!' do
|
31
|
+
let(:tool_path) { LoweredExpectations.which(tool) }
|
32
|
+
let(:tool_output) { `#{tool_path} --version` }
|
33
|
+
it 'returns stdout' do
|
34
|
+
expect(LoweredExpectations.send('run!', tool, '--version').delete("\r")).to eq tool_output
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'returns stdout in quiet mode' do
|
38
|
+
expect(LoweredExpectations.send('run!', tool, '--version', quiet: true).delete("\r")).to eq tool_output
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'raises an error when the executable returns non-zero' do
|
42
|
+
expect{LoweredExpectations.send('run!', tool, '--versssion')}
|
43
|
+
.to raise_error(LoweredExpectations::CommandExecutionError)
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'raises an error when the executable returns non-zero in quiet mode' do
|
47
|
+
expect{LoweredExpectations.send('run!', tool, '--versssion', quiet: true)}
|
48
|
+
.to raise_error(LoweredExpectations::CommandExecutionError)
|
49
|
+
end
|
50
|
+
end
|
29
51
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lowered-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Chesal
|
8
8
|
- Derek Tamsen
|
9
|
+
- Grier Johnson
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2018-
|
13
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
13
14
|
dependencies: []
|
14
15
|
description: |
|
15
16
|
A Ruby gem that lets you test for the presence of command line tools and ensure
|
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
version: '0'
|
65
66
|
requirements: []
|
66
67
|
rubyforge_project:
|
67
|
-
rubygems_version: 2.6.
|
68
|
+
rubygems_version: 2.6.14.1
|
68
69
|
signing_key:
|
69
70
|
specification_version: 4
|
70
71
|
summary: A library for testing versions of command line tools.
|