Hey there. I've been able to set up tests for Sass-only projects thanks to this article, so thanks!
Along the way, I've stumbled across a few things that spawned build fails:
If you're using the latest version of Sass, make sure Ruby is using the latest version as well. Travis doesn't provide the latest version (2.4.1) of Ruby on standard, which prompted a build fail. I updated my .travis.yml like this:
script:
- "test/travis.rb"
language: ruby
rvm:
- 2.4.1
before_install:
- gem install sass
- chmod +x test/travis.rb
Also Sass now adds sourcemaps on default when you compile to a compressed css. In case of those silent class checks, that you mentioned at the end of your article, this will spawn a build fail again.
This is because the file isn't empty anymore but contains the sourcemap file's name in comments. To counter this, you have to add --sourcemap=none to avoid Sass from generating a sourcemap file.
The test ultimately becomes:
result = `sass test/silent.scss build.silent.css -t compressed --sourcemap=none`
raise result unless $?.to_i == 0
raise "When $use-silent-classes is set to true the module should not output any CSS" unless File.size('build.silent.css') == 0
puts "Silent sass compiled successfully"
Anyway, thanks again for the handy article. Hope my contribution can help someone out there as well!
Hey there. I've been able to set up tests for Sass-only projects thanks to this article, so thanks!
Along the way, I've stumbled across a few things that spawned build fails:
If you're using the latest version of Sass, make sure Ruby is using the latest version as well. Travis doesn't provide the latest version (2.4.1) of Ruby on standard, which prompted a build fail. I updated my .travis.yml like this:
Also Sass now adds sourcemaps on default when you compile to a compressed css. In case of those silent class checks, that you mentioned at the end of your article, this will spawn a build fail again.
This is because the file isn't empty anymore but contains the sourcemap file's name in comments. To counter this, you have to add
--sourcemap=noneto avoid Sass from generating a sourcemap file.The test ultimately becomes:
Anyway, thanks again for the handy article. Hope my contribution can help someone out there as well!