Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1 nameerror bin not found #3

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ SelfAssignment:
SignalException:
Enabled: false

# Offense count: 53
# Cop supports --auto-correct.
SingleSpaceBeforeFirstArg:
Enabled: false

SpaceAroundOperators:
Enabled: false

Expand Down Expand Up @@ -214,6 +209,9 @@ Style/EmptyLines:
Style/EmptyLinesAroundAccessModifier:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/GuardClause:
Enabled: false

Expand Down Expand Up @@ -304,10 +302,6 @@ Style/NumericLiterals:
Metrics/ParameterLists:
Enabled: false

Style/TrailingComma:
# EnforcedStyleForMultiline: comma
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Expand Down
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
source 'https://rubygems.org'

gemspec

group :development, :test do
gem "bundler", "~> 1.7"
gem "rake", "~> 10.4"
gem "rspec", "~> 3.0"
gem "rspec-mocks", "~> 3.0"
gem "rubocop", "~> 0.36"
gem "rubygems-tasks", "~> 0.2"
end
6 changes: 3 additions & 3 deletions lib/lowered/expectations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require 'pty'

class LoweredExpectations
VERSION = '1.0.0'
VERSION = '1.0.1'.freeze

class VersionPatternError < StandardError
end
Expand Down Expand Up @@ -33,7 +33,7 @@ def self.which(cmd)
return exe if File.executable?(exe) && !File.directory?(exe)
end
end
raise MissingExecutableError.new("#{executable} not found in #{ENV['PATH']}")
raise MissingExecutableError.new("#{cmd} not found in #{ENV['PATH']}")
end

def self.verify_version(version, pattern)
Expand All @@ -54,7 +54,7 @@ def self.run!(*args, quiet: false)
while !r.eof?
c = r.getc
stdout << c
$stdout.write "#{c}"
$stdout.write c.to_s
end
Process.wait(pid)
end
Expand Down
7 changes: 0 additions & 7 deletions lowered-expectations.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,4 @@ END
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.4"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rspec-mocks", "~> 3.0"
spec.add_development_dependency "rubocop", "~> 0.24"
spec.add_development_dependency "rubygems-tasks", "~> 0.2"
end
4 changes: 2 additions & 2 deletions spec/integration/lowered/expectations_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

describe '.which' do
it 'returns true when the executable is on the PATH' do
expect(LoweredExpectations.which tool).to be_truthy
expect(LoweredExpectations.which(tool)).to be_truthy
end

it 'raises an error when the executable is not on the PATH' do
expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error
expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error(LoweredExpectations::MissingExecutableError)
end
end
end
16 changes: 8 additions & 8 deletions spec/lowered/expectations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@

describe '.which' do
it 'returns true when the executable is on the PATH' do
expect(LoweredExpectations.which tool).to be_truthy
expect(LoweredExpectations.which(tool)).to be_truthy
end

it 'raises an error when the executable is not on the PATH' do
expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error
expect{LoweredExpectations.which 'sometoolthatdoesnotexist'}.to raise_error(LoweredExpectations::MissingExecutableError)
end
end

describe '.verify_version' do
it 'returns true when the version string matches the version pattern' do
expect(LoweredExpectations.verify_version version, '~> 0.1').to be_truthy
expect(LoweredExpectations.verify_version version, '~> 0').to be_truthy
expect(LoweredExpectations.verify_version version, '> 0.1.1').to be_truthy
expect(LoweredExpectations.verify_version version, '< 1').to be_truthy
expect(LoweredExpectations.verify_version version, '> 0').to be_truthy
expect(LoweredExpectations.verify_version version, "= #{version}").to be_truthy
expect(LoweredExpectations.verify_version(version, '~> 0.1')).to be_truthy
expect(LoweredExpectations.verify_version(version, '~> 0')).to be_truthy
expect(LoweredExpectations.verify_version(version, '> 0.1.1')).to be_truthy
expect(LoweredExpectations.verify_version(version, '< 1')).to be_truthy
expect(LoweredExpectations.verify_version(version, '> 0')).to be_truthy
expect(LoweredExpectations.verify_version(version, "= #{version}")).to be_truthy
end

it 'raise an error when the version string does not match the version pattern' do
Expand Down