Permalink
Browse files

Fix some tests

  • Loading branch information...
1 parent 8d74599 commit 7226180d4adfcf3e3e024a6ab8b51ebe84746f3e @hawx committed Nov 7, 2014
Showing with 18 additions and 12 deletions.
  1. +7 −4 spec/guard/sass/runner_spec.rb
  2. +11 −8 spec/guard/sass_spec.rb
@@ -57,7 +57,6 @@
end
it 'compiles the files' do
- a = Guard::Sass::DEFAULTS[:load_paths]
Guard::Sass::DEFAULTS[:load_paths] = ['sass']
mock_engine = mock(::Sass::Engine)
@@ -68,13 +67,17 @@
:debug_info => false,
:line_numbers => false,
:syntax => :sass,
- :filename => 'a.sass'
+ :filename => 'a.sass',
+ :all_on_start => false,
+ :output => "css",
+ :extension => ".css",
+ :shallow => false,
+ :noop => false,
+ :hide_success => false
}).and_return(mock_engine)
mock_engine.should_receive(:render)
subject.new([watcher], formatter, defaults).run(['a.sass'])
-
- Guard::Sass::DEFAULTS[:load_paths] = a
end
end
@@ -23,13 +23,16 @@
context 'when options given' do
subject {
+ Guard::Sass::DEFAULTS[:load_paths] = ['sass']
+
opts = {
:noop => true,
:hide_success => true,
:style => :compact,
- :line_numbers => true
+ :line_numbers => true,
+ :watchers => []
}
- Guard::Sass.new([], opts)
+ Guard::Sass.new(opts)
}
it 'merges them with defaults' do
@@ -43,13 +46,13 @@
:noop => true,
:hide_success => true,
:line_numbers => true,
- :load_paths => ::Sass::Plugin.template_location_array.map(&:first)
+ :load_paths => ['sass']
}
end
end
context 'with an :input option' do
- subject { Guard::Sass.new([], {:input => 'app/styles'}) }
+ subject { Guard::Sass.new(watchers: [], input: 'app/styles') }
it 'creates a watcher' do
subject.should have(1).watchers
@@ -66,7 +69,7 @@
end
context 'with an output option' do
- subject { Guard::Sass.new([], {:input => 'app/styles', :output => 'public/styles'}) }
+ subject { Guard::Sass.new(input: 'app/styles', output: 'public/styles', watchers: []) }
it 'uses the output directory' do
subject.options[:output].should == 'public/styles'
@@ -83,7 +86,7 @@
end
context ':all_on_start option is true' do
- subject { Guard::Sass.new [], :all_on_start => true }
+ subject { Guard::Sass.new(watchers: [], all_on_start: true) }
it 'calls #run_all' do
subject.should_receive(:run_all)
@@ -93,7 +96,7 @@
end
describe '#run_all' do
- subject { Guard::Sass.new([Guard::Watcher.new('(.*)\.s[ac]ss')]) }
+ subject { Guard::Sass.new(watchers: [Guard::Watcher.new('(.*)\.s[ac]ss')]) }
before do
Dir.stub(:[]).and_return ['a.sass', 'b.scss', 'c.ccss', 'd.css', 'e.scsc']
@@ -106,7 +109,7 @@
end
describe '#run_on_changes' do
- subject { Guard::Sass.new([Guard::Watcher.new('(.*)\.s[ac]ss')]) }
+ subject { Guard::Sass.new(watchers: [Guard::Watcher.new('(.*)\.s[ac]ss')]) }
context 'if paths given contain partials' do
it 'calls #run_all' do

0 comments on commit 7226180

Please sign in to comment.