-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow official command to be aliased (#246)
Fixes #245 * Allow hardcoded command as aliases for all framework commands * Refactor commands * Rename one_command to batched_command with references * E2E tests with alias commands
- Loading branch information
Showing
26 changed files
with
492 additions
and
217 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
bin/rails test $@ |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
bundle exec rspec $@ |
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,9 +1,74 @@ | ||
require 'retest' | ||
require_relative 'support/test_helper' | ||
require 'minitest/autorun' | ||
require_relative 'retest_test/file_changes_test' | ||
require_relative 'retest_test/flags_test' | ||
require_relative 'retest_test/setup_test' | ||
require_relative 'retest_test/file_changes' | ||
|
||
$stdout.sync = true | ||
|
||
class TestDefaultCommand < Minitest::Test | ||
include RetestHelper | ||
include FileChanges | ||
|
||
def setup | ||
@command = "retest" | ||
end | ||
|
||
def teardown | ||
end_retest | ||
end | ||
|
||
def test_repository_setup | ||
assert_equal :rspec, Retest::Setup.new.type | ||
end | ||
|
||
def test_starting_details | ||
launch_retest @command | ||
|
||
assert_output_matches <<~OUTPUT | ||
Setup: [RSPEC] | ||
Command: 'bundle exec rspec <test>' | ||
Watcher: [LISTEN] | ||
Launching Retest... | ||
Ready to refactor! You can make file changes now | ||
OUTPUT | ||
|
||
modify_file('lib/bottles.rb') | ||
|
||
assert_output_matches "Test file: spec/bottles_spec.rb" | ||
end | ||
end | ||
|
||
class TestAliasCommand < Minitest::Test | ||
include RetestHelper | ||
include FileChanges | ||
|
||
def setup | ||
@command = "retest --rspec 'bin/retest <test>'" | ||
end | ||
|
||
def teardown | ||
end_retest | ||
end | ||
|
||
def test_repository_setup | ||
assert_equal :rspec, Retest::Setup.new.type | ||
end | ||
|
||
def test_starting_details | ||
launch_retest @command | ||
|
||
assert_output_matches <<~OUTPUT | ||
Setup: [RSPEC] | ||
Command: 'bin/retest <test>' | ||
Watcher: [LISTEN] | ||
Launching Retest... | ||
Ready to refactor! You can make file changes now | ||
OUTPUT | ||
|
||
modify_file('lib/bottles.rb') | ||
|
||
assert_output_matches "Test file: spec/bottles_spec.rb" | ||
end | ||
end |
24 changes: 5 additions & 19 deletions
24
...y/retest/retest_test/file_changes_test.rb → ...c-ruby/retest/retest_test/file_changes.rb
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.