lowered-expectations 1.0.2 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fd98bbb73967a109a601bfead6bcbe8f3431646
4
- data.tar.gz: cc882dfd03ebec15f64e7b1ad7e50d7d1e12c353
3
+ metadata.gz: f17c84deb4d08951a3eaba2467b6eb565adc9736
4
+ data.tar.gz: febd20b442c3b8fae728ef969951f9264df23289
5
5
  SHA512:
6
- metadata.gz: 8546cbb024fa93345bf7a258368dc957184ef4cce5ea02730c87a804a64ff1dd3bf316402831b094409b52c2b25af59d377033a82134252a67363971ae02d72b
7
- data.tar.gz: 1cace52623498e077b6ac55c6d5980d7e886d3b73e151c5b81e88dda708f2557e517729d514b64768d170a46ba3ef7a2bc41371137d4ae61336ac9f3ba9f299b
6
+ metadata.gz: 1e8e70bf8c64473fdd8b524aeec08e6035304ed43c0e04d3dc618f9ac2faef43ae41488dbd4ed67af583388125c770c2b55e5c95ca52131bbf10d0fbd8d267ec
7
+ data.tar.gz: 1eb2eeb5f8ba99a4932907815503f3cc5b97d20e79afab708a4adf245ae980688c2800a17d609c124f7be417275d1d60dd6685ae06944c2210acf5f2d486e237
data/COPYRIGHT CHANGED
@@ -4,6 +4,7 @@ Including, but not limited to:
4
4
 
5
5
  Ian Chesal
6
6
  Derek Tamsen
7
+ Grier Johnson
7
8
 
8
9
  For licensing information please see LICENSE. Copyright holders contributing to
9
10
  this project agree to have their contributions licensed under the terms of the
data/RELEASENOTES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # lowered-expectations Release Notes
2
2
 
3
+ ## 1.0.3
4
+
5
+ * Bugfix for exitstatus checks when running in quiet mode
6
+
3
7
  ## 1.0.2
4
8
 
5
9
  * Updated rubocop library to cover CVE-2017-8418
@@ -4,7 +4,7 @@ require 'shellwords'
4
4
  require 'pty'
5
5
 
6
6
  class LoweredExpectations
7
- VERSION = '1.0.2'.freeze
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.2
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-08-03 00:00:00.000000000 Z
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.13
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.