Skip to content

Commit

Permalink
* Stop rescuing YAML parsing error
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Nov 15, 2016
1 parent f426120 commit e0084a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions lib/asset_sync/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions spec/unit/asset_sync_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e0084a2

Please sign in to comment.