-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
236 additions
and
1,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
Feature: Builtins.getenv() | ||
|
||
Scenario: With string literal parameter is translated to ENV equivalent | ||
Given the original code is | ||
""" | ||
Builtins.getenv("foo") | ||
""" | ||
""" | ||
Builtins.getenv("foo") | ||
""" | ||
When I correct it using RuboCop::Cop::Yast::Builtins cop | ||
Then the code should be converted to | ||
""" | ||
ENV["foo"] | ||
""" | ||
""" | ||
ENV["foo"] | ||
""" | ||
|
||
Scenario: Variable as parameter is preserved | ||
Given the original code is | ||
""" | ||
foo = bar | ||
Builtins.getenv(foo) | ||
""" | ||
""" | ||
foo = bar | ||
Builtins.getenv(foo) | ||
""" | ||
When I correct it using RuboCop::Cop::Yast::Builtins cop | ||
Then the code should be converted to | ||
""" | ||
foo = bar | ||
ENV[foo] | ||
""" | ||
""" | ||
foo = bar | ||
ENV[foo] | ||
""" | ||
|
||
Scenario: Any other statement is preserved | ||
Given the original code is | ||
""" | ||
Builtins.getenv(Ops.add(foo, bar)) | ||
""" | ||
""" | ||
Builtins.getenv(Ops.add(foo, bar)) | ||
""" | ||
When I correct it using RuboCop::Cop::Yast::Builtins cop | ||
Then the code should be converted to | ||
""" | ||
ENV[Ops.add(foo, bar)] | ||
""" | ||
""" | ||
ENV[Ops.add(foo, bar)] | ||
""" |
Oops, something went wrong.