Skip to content

Commit

Permalink
Merge pull request #698 from cucumber/clean-up-linting
Browse files Browse the repository at this point in the history
Clean up linting and fix environment nesting
  • Loading branch information
mvz authored Jan 4, 2020
2 parents 65f4800 + 50f6952 commit 8b7dc95
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ Aruba's Rakefile provides the following linting tasks
bundle exec rake lint # Run all linters
bundle exec rake lint:coding_guidelines # Lint our code with "rubocop"
bundle exec rake lint:licenses # Check for relevant licenses in project
bundle exec rake lint:travis # Lint our .travis.yml
```

### Building and installing your local Aruba version
Expand Down
10 changes: 2 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bundler.setup
task default: %w(spec cucumber cucumber:wip lint)

desc 'Run all linters.'
task lint: %w(lint:travis lint:coding_guidelines lint:licenses)
task lint: %w(lint:coding_guidelines lint:licenses)

desc 'Run the whole test suite.'
task test: %w(spec cucumber cucumber:wip)
Expand All @@ -31,15 +31,9 @@ end
RSpec::Core::RakeTask.new

namespace :lint do
desc 'Lint our .travis.yml'
task :travis do
puts 'Linting .travis.yml ...'
sh 'travis lint'
end

desc 'Lint our code with "rubocop"'
task :coding_guidelines do
sh 'bundle exec rubocop --fail-level E'
sh 'bundle exec rubocop'
end

desc 'Check for relevant licenses in project'
Expand Down
1 change: 0 additions & 1 deletion aruba.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ to make testing commandline applications meaningful, easy and fun.'
spec.add_development_dependency 'rubocop', '~> 0.78.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
spec.add_development_dependency 'simplecov', '~> 0.17.1'
spec.add_development_dependency 'travis', '~> 1.8'
spec.add_development_dependency 'yard-junk', '~> 0.0.7'

spec.rubygems_version = '>= 1.6.1'
Expand Down
8 changes: 4 additions & 4 deletions lib/aruba/platforms/unix_environment_variables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ def clear
value
end

def nest(&block)
old_actions = actions
block.call(self)
def nest
old_actions = @actions.dup
yield(self)
ensure
actions = old_actions
@actions = old_actions
end

def self.hash_from_env
Expand Down
11 changes: 11 additions & 0 deletions spec/aruba/api/core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@
expect(ENV[variable]).to eq '2'
end

it 'forgets passed argument when called again' do
variable = 'THIS_IS_A_ENV_VAR'

@aruba.with_environment variable => 2 do
end

@aruba.with_environment do
expect(ENV[variable]).to be_nil
end
end

it 'keeps values not set in argument' do
variable = 'THIS_IS_A_ENV_VAR'
ENV[variable] = '2'
Expand Down

0 comments on commit 8b7dc95

Please sign in to comment.