From f3f0ad82106214d23a98f6fccaf6c660474a75eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=CC=8Ci=CC=81z=CC=8C?= Date: Tue, 18 Sep 2018 14:21:35 +0200 Subject: [PATCH] [Spec] fix test for stylus --- spec/unit/compiler/file/stylus_file_spec.rb | 39 ++++++++++----------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/spec/unit/compiler/file/stylus_file_spec.rb b/spec/unit/compiler/file/stylus_file_spec.rb index cfc629a..71973e8 100755 --- a/spec/unit/compiler/file/stylus_file_spec.rb +++ b/spec/unit/compiler/file/stylus_file_spec.rb @@ -60,22 +60,22 @@ module FileTypes end it 'allows to use constants inside stylus files' do - source = %q( -__abc = { - hej: "hou" -} - -a - // value: __const.some_value - value: __abc.hej - -) - + source = <<~STYLUS + __abc = { + hej: "hou" + } + + a + // value: __const.some_value + value: __abc.hej + value2: __const.some_value + + STYLUS File.write('/tmp/epuber_stylus_tests/some_file.styl', source) file = StylusFile.new('/tmp/epuber_stylus_tests/some_file.styl') - file.destination_path = 'some_file.css' + file.destination_path = '/tmp/epuber_stylus_tests/some_file.css' file.compilation_context = ctx resolve_file_paths(file) @@ -83,18 +83,17 @@ module FileTypes file.process(ctx) + expected = <<~CSS + a { + value: "hou"; + value2: "abc"; + } + CSS - puts File.read(file.final_destination_path) - + expect(File.read(file.final_destination_path)).to eq expected end end - - - end - - - end end end