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

Delete ENV variable fails in Windows #349

Closed
MRod15 opened this issue Mar 29, 2016 · 2 comments
Closed

Delete ENV variable fails in Windows #349

MRod15 opened this issue Mar 29, 2016 · 2 comments
Labels

Comments

@MRod15
Copy link

MRod15 commented Mar 29, 2016

Summary

Deleting ENV variables is failing in Windows with the error:
wrong number of arguments (1 for 2) (ArgumentError)

No backtrace is given!

Expected Behavior

Variable should be removed from ENV.

Current Behavior

see Steps to Reproduce (for bugs)

Possible Solution

Followed the error to:

{ArgumentError} wrong number of arguments (1 for 2)
"C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/platforms/windows_environment_variables.rb:84:in delete'" "C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/api/deprecated.rb:406:inblock in restore_env'"
"C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/api/deprecated.rb:401:in each'" "C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/api/deprecated.rb:401:inrestore_env'"
"C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/cucumber/hooks.rb:19:in `After'"

and found that the delete method, which is inherited from UnixEnvironmentVariables, has an extra argument that its super.

Steps to Reproduce (for bugs)

irb(main):001:0> require 'aruba'
=> true
irb(main):003:0> env = Aruba::Platforms::WindowsEnvironmentVariables.new
=> ...
irb(main):004:0> env['foo']='bar'
=> "bar"
irb(main):005:0> env['foo']
=> "bar"
irb(main):006:0> env.delete 'foo'
ArgumentError: wrong number of arguments (1 for 2)
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/aruba-0.14.0/lib/aruba/platforms/windows_environment_variables.rb:84:in `delete'
        from (irb):6
        from C:/Ruby22/bin/irb:11:in `<main>'

Context

Scenario fails "silently" after steps in an Aruba hook (After) afecting test results.

Environment

  • Aruba 0.14.0 @ Ruby 2.2.0
  • Windows 8.1
@ghost
Copy link

ghost commented Mar 30, 2016

Thanks for reporting this. This should be fixed when #350 is merged.

@ghost ghost added the bug label Mar 30, 2016
@ghost
Copy link

ghost commented Apr 1, 2016

Should be fixed in master.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant