spec/less/parser_spec.rb in less-2.3.3 vs spec/less/parser_spec.rb in less-2.4.0
- old
+ new
@@ -13,11 +13,11 @@
root = subject.parse(".class {width: 1+1}")
root.to_css.gsub(/\n/,'').should eql ".class { width: 2;}"
end
it "accepts options when assembling the parse tree" do
- subject.parse(".class {width: 1+1}").to_css(:compress => true).strip.should eql ".class{width:2;}"
+ subject.parse(".class {width: 1+1}").to_css(:compress => true).strip.should eql ".class{width:2}"
end
end
it "throws a ParseError if the lesscss is bogus" do
lambda { subject.parse('{^)') }.should raise_error(Less::ParseError, /missing closing `\}`/)
@@ -60,12 +60,12 @@
begin
subject.parse('@import "faulty.less";').to_css
rescue Less::ParseError => e
e.type.should == 'Name'
e.filename.should == cwd.join('faulty/faulty.less').to_s
- e.line.should == 1
- e.column.should == 16
+ e.line.should == 2
+ e.column.should == 9
else
fail "parse error not raised"
end
end
@@ -153,12 +153,12 @@
# with something that won't fail (since we're not in Node.JS)
less_content.sub!('process.title', '"node"')
end
it "#{base_name}.less" do
- parser = Less::Parser.new(:paths => [ File.dirname(less_file) ])
+ parser = Less::Parser.new(:filename => less_file, :paths => [ File.dirname(less_file) ])
less = parser.parse( less_content )
- less.to_css.should == File.read(css_file)
+ less.to_css(:strictMath => true, :silent => true).should == File.read(css_file)
end
end
end