Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 89d3d8d

Browse files
author
Adam Garstka
committed
Add spec for including only *.css files
1 parent 3287ef7 commit 89d3d8d

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/cc/engine/csslint_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'cc/engine/csslint'
2+
require 'tmpdir'
3+
4+
module CC
5+
module Engine
6+
describe CSSlint do
7+
let(:code) { Dir.mktmpdir }
8+
let(:lint) { CSSlint.new(directory: code, io: nil, engine_config: {}) }
9+
let(:content) { '#id { color: red; }' }
10+
11+
describe '#run' do
12+
it 'analyzes *.css files' do
13+
create_source_file('foo.css', content)
14+
expect{ lint.run }.to output(/Don't use IDs in selectors./).to_stdout
15+
end
16+
17+
it "doesn't analyze *.scss files" do
18+
create_source_file('foo.scss', content)
19+
expect{ lint.run }.to_not output.to_stdout
20+
end
21+
22+
def create_source_file(path, content)
23+
File.write(File.join(code, path), content)
24+
end
25+
end
26+
end
27+
end
28+
end

0 commit comments

Comments
 (0)