Skip to content

Commit 890a2bc

Browse files
alex-slynkosds
authored andcommitted
Fix rake task and add test for it
Change-Id: Idc7564816b430066672a624301390937e55d3c81 Reviewed-on: http://gerrit.causes.com/45246 Tested-by: jenkins <[email protected]> Reviewed-by: Shane da Silva <[email protected]>
1 parent 2f5546b commit 890a2bc

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

lib/scss_lint/rake_task.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ def run_task
2929
require 'scss_lint'
3030
require 'scss_lint/cli'
3131

32-
CLI.new([]).tap do |cli|
33-
cli.parse_arguments
34-
cli.run
35-
end
32+
CLI.new.run([])
3633
rescue SystemExit => ex
3734
if ex.status == CLI::EXIT_CODES[:data]
3835
abort('scss-lint found lints')

spec/scss_lint/rake_task_spec.rb

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
require 'spec_helper'
2+
require 'scss_lint/rake_task'
3+
4+
describe SCSSLint::RakeTask do
5+
before do
6+
# Silence console output
7+
STDOUT.stub(:write)
8+
end
9+
10+
describe '#run' do
11+
subject do
12+
SCSSLint::RakeTask.new
13+
Rake::Task['scss_lint']
14+
end
15+
16+
it 'returns a successful exit code' do
17+
expect(subject.invoke.first.call).to be_truthy
18+
end
19+
end
20+
end

0 commit comments

Comments
 (0)