-
Notifications
You must be signed in to change notification settings - Fork 40
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
1 parent
71adf6a
commit 6808530
Showing
6 changed files
with
61 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "test_boosters" | ||
|
||
exit(TestBoosters::Boosters::Minitest.new.run) |
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,17 @@ | ||
module TestBoosters | ||
module Boosters | ||
class Minitest < Base | ||
|
||
FILE_PATTERN = "test/**/*/_test.rb".freeze | ||
|
||
def initialize | ||
super(FILE_PATTERN, split_configuration_path, "ruby") | ||
end | ||
|
||
def split_configuration_path | ||
ENV["MINITEST_SPLIT_CONFIGURATION_PATH"] || "#{ENV["HOME"]}/minitest_split_configuration.json" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "spec_helper" | ||
|
||
describe TestBoosters::Boosters::Minitest do | ||
before do | ||
allow(TestBoosters::CliParser).to receive(:parse).and_return(:job_index => 10, :job_count => 32) | ||
end | ||
|
||
subject(:booster) { described_class.new } | ||
|
||
describe "#split_configuration_path" do | ||
before { ENV["MINITEST_SPLIT_CONFIGURATION_PATH"] = "/tmp/path.txt" } | ||
|
||
context "when the environment variable is set" do | ||
it "returns its values" do | ||
expect(booster.split_configuration_path).to eq("/tmp/path.txt") | ||
end | ||
end | ||
|
||
context "when the environment variable is not set" do | ||
before { ENV.delete("MINITEST_SPLIT_CONFIGURATION_PATH") } | ||
|
||
it "returns the path from the home directory" do | ||
expect(booster.split_configuration_path).to eq("#{ENV["HOME"]}/minitest_split_configuration.json") | ||
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