Skip to content

Commit 62cae33

Browse files
committed
Implement CommandLine#all?
1 parent c129b4d commit 62cae33

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/matrixeval/ruby/command_line.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ def init?
1414
argv[0] == 'init'
1515
end
1616

17+
def all?
18+
argv[0] == 'all'
19+
end
20+
1721
def context_options
1822
ParseContextArguments.call(context_arguments)
1923
end

test/matrixeval/ruby/command_line_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ def test_init?
1212
refute command.init?
1313
end
1414

15+
def test_all?
16+
command = Matrixeval::Ruby::CommandLine.new(["all", "rake", "test"])
17+
assert command.all?
18+
19+
command = Matrixeval::Ruby::CommandLine.new(["rake", "test"])
20+
refute command.all?
21+
end
22+
1523
def test_context_arguments
1624
command = Matrixeval::Ruby::CommandLine.new([
1725
"--ruby", "3.0",

0 commit comments

Comments
 (0)