Sha256: c5598ca37522fe052736ab2680a7538907132ec9339147b4d55499229c0cc77a
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
require 'spec_helper' class BasicsSpec < Less::Rails::Spec it 'must render variables' do basics.must_match %r{#test-variable\{color:#4d926f;\}} end it 'must render mixins' do basics.must_match %r{#test-mixin span\{border:1px solid black;\}} end it 'must be able to use vendored less files' do basics.must_match %r{#test-vendored\{border-radius:10px;\}} end it 'must hook into less import so that imported paths are declared as sprocket dependencies of the source file' do basics.must_match %r{#test-radiused\{border-radius:5px;\}}, 'default is 5px' safely_edit_mixins do |d| d.gsub! '5px', '10px' File.open(mixins_asset.pathname,'w') { |f| f.write(d) } basics.must_match %r{#test-radiused\{border-radius:10px;\}}, 'mixins.less should be a sprockets context dependency' end end protected def basics dummy_asset 'basics' end def mixins_asset dummy_assets['frameworks/bootstrap/mixins.less'] end def safely_edit_mixins data = File.read(mixins_asset.pathname) begin yield data.dup ensure File.open(mixins_asset.pathname,'w') { |f| f.write(data) } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
less-rails-2.1.5 | test/cases/basics_spec.rb |
less-rails-2.1.4 | test/cases/basics_spec.rb |
less-rails-2.1.3 | test/cases/basics_spec.rb |