-
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.
- Loading branch information
Showing
9 changed files
with
72 additions
and
32 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,23 @@ | ||
module Retest | ||
class Command | ||
class Base | ||
def initialize(all: false, file_system: FileSystem, command: nil) | ||
@file_system = file_system | ||
@all = all | ||
@command = command | ||
end | ||
|
||
def to_s | ||
raise NotImplementedError | ||
end | ||
|
||
def format_batch(*files) | ||
raise NotImplementedError | ||
end | ||
|
||
private | ||
|
||
attr_reader :all, :file_system, :command | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Retest | ||
class Command | ||
class Hardcoded < Base | ||
def to_s | ||
@command | ||
end | ||
|
||
def format_batch(*files) | ||
end | ||
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
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
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
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,26 @@ | ||
require 'test_helper' | ||
require_relative 'command_interface' | ||
|
||
module Retest | ||
class Command | ||
class HardcodedTest < MiniTest::Test | ||
def setup | ||
@subject = Hardcoded.new(command: 'echo "hello world"') | ||
end | ||
|
||
include CommandInterface | ||
|
||
def test_to_s | ||
assert_equal 'echo "hello world"', @subject.to_s | ||
end | ||
|
||
def test_format_with_one_file | ||
assert_nil @subject.format_batch('a/file/path.rb') | ||
end | ||
|
||
def test_format_with_multiple_files | ||
assert_nil @subject.format_batch('a/file/path.rb', 'another/file/path.rb') | ||
end | ||
end | ||
end | ||
end |