-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from spk/tests
Add test
- Loading branch information
Showing
8 changed files
with
67 additions
and
2 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 |
---|---|---|
@@ -1 +1,9 @@ | ||
require 'bundler/gem_tasks' | ||
require 'rake/testtask' | ||
|
||
task default: [:test] | ||
|
||
Rake::TestTask.new do |t| | ||
t.pattern = 'test/**/*_test.rb' | ||
end | ||
task spec: :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
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,12 @@ | ||
require_relative '../../test_helper' | ||
require 'rubocop/git/cli' | ||
|
||
describe RuboCop::Git::CLI do | ||
it 'fail with invalid options' do | ||
proc do | ||
_out, _err = capture_io do | ||
RuboCop::Git::CLI.new.run(['--gruß']) | ||
end | ||
end.must_raise(SystemExit) | ||
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,18 @@ | ||
require_relative '../../test_helper' | ||
require 'rubocop/git/options' | ||
|
||
describe RuboCop::Git::Options do | ||
it 'fail with no options' do | ||
proc do | ||
RuboCop::Git::Options.new({}) | ||
end.must_raise(RuboCop::Git::Options::Invalid) | ||
end | ||
|
||
it 'can pass string hash options' do | ||
RuboCop::Git::Options.new('rubocop' => {}, 'commits' => []) | ||
end | ||
|
||
it 'can pass symbol hash options' do | ||
RuboCop::Git::Options.new(rubocop: {}, commits: []) | ||
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,23 @@ | ||
require_relative '../../test_helper' | ||
require 'rubocop/git/runner' | ||
|
||
describe RuboCop::Git::Runner do | ||
it 'exit with violations' do | ||
options = RuboCop::Git::Options.new | ||
# lib/rubocop/git/runner.rb:14:1: C: Trailing whitespace detected. | ||
options.commits = ["v0.0.4", "v0.0.5"] | ||
proc do | ||
_out, _err = capture_io do | ||
RuboCop::Git::Runner.new.run(options) | ||
end | ||
end.must_raise(SystemExit) | ||
end | ||
|
||
it 'fail with no options' do | ||
proc do | ||
_out, _err = capture_io do | ||
RuboCop::Git::Runner.new.run({}) | ||
end | ||
end.must_raise(RuboCop::Git::Options::Invalid) | ||
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,2 @@ | ||
require 'minitest/autorun' | ||
require 'rubocop/git' |