spec/unit/initializers/sprockets_spec.rb in locomotivecms_steam-1.0.0 vs spec/unit/initializers/sprockets_spec.rb in locomotivecms_steam-1.0.1

- old
+ new

@@ -20,6 +20,42 @@ end end + describe '#install_autoprefixer' do + + let(:options) { { minify: false } } + + subject { env } + + context "config/autoprefixer.yml doesn't exist" do + + before { allow(File).to receive(:exists?).and_return false } + + it { expect(AutoprefixerRails).not_to receive(:install); subject } + + end + + context "config/autoprefixer.yml exists" do + + before { + allow(File).to receive(:exists?).and_return(true) + allow(YAML).to receive(:load_file).and_return({}) + } + + it { expect(AutoprefixerRails).to receive(:install).and_return(true); subject } + + it 'warns developers if they notice bad performance when using autoprefixer' do + curent_execjs_runtime = ENV['EXECJS_RUNTIME'] + ENV['EXECJS_RUNTIME'] = 'NodeJS' + expect(Locomotive::Common::Logger).not_to receive(:warn) + expect(AutoprefixerRails).to receive(:install).and_return(true) + subject + ENV['EXECJS_RUNTIME'] = curent_execjs_runtime + end + + end + + end + end