diff --git a/lib/asset_sync/config.rb b/lib/asset_sync/config.rb index f6023039..965ec43a 100644 --- a/lib/asset_sync/config.rb +++ b/lib/asset_sync/config.rb @@ -116,8 +116,6 @@ def yml_exists? def yml @yml ||= YAML.load(ERB.new(IO.read(yml_path)).result)[Rails.env] || {} - rescue Psych::SyntaxError - @yml = {} end def yml_path diff --git a/spec/unit/asset_sync_spec.rb b/spec/unit/asset_sync_spec.rb index 630ea14d..a0f19145 100644 --- a/spec/unit/asset_sync_spec.rb +++ b/spec/unit/asset_sync_spec.rb @@ -249,18 +249,12 @@ end describe 'with invalid yml' do - before(:each) do set_rails_root('with_invalid_yml') - AssetSync.config = AssetSync::Config.new end - it "config should be invalid" do - expect(AssetSync.config.valid?).to be_falsey - end - - it "should raise a config invalid error" do - expect{ AssetSync.sync }.to raise_error() + it "an error" do + expect{ AssetSync::Config.new }.to raise_error(Psych::SyntaxError) end end end