-
Notifications
You must be signed in to change notification settings - Fork 1
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
Andre Medeiros
committed
Jul 5, 2020
1 parent
715aeb3
commit 23982d8
Showing
3 changed files
with
26 additions
and
11 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,24 +1,32 @@ | ||
require 'test_helper' | ||
|
||
class TestRuby < Loon::Test | ||
def test_versions | ||
def test_ruby_versions | ||
dependency_test :ruby | ||
%w(2.6.6 2.7.1).each do |version| | ||
with_payload(deps: {'ruby' => version}) do | ||
loon %w(exec ruby --version) | ||
|
||
assert_status 0 | ||
assert_stdout version | ||
end | ||
test_ruby_dep version: version, match: version | ||
end | ||
end | ||
|
||
def test_default | ||
with_payload(deps: 'ruby') do | ||
dependency_test :ruby | ||
test_ruby_dep match: '2.7.1' | ||
end | ||
|
||
private | ||
|
||
def test_ruby_dep(version: nil, match:) | ||
dep = if version | ||
{'ruby' => version} | ||
else | ||
'ruby' | ||
end | ||
|
||
with_payload(deps: dep) do | ||
loon %w(exec ruby --version) | ||
|
||
assert_status 0 | ||
assert_stdout '2.7.1' | ||
assert_stdout match | ||
end | ||
end | ||
end | ||
|
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