Skip to content

Commit

Permalink
Add test for unreadable predicates file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Bazan committed Aug 23, 2015
1 parent 1e759ab commit 7419680
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/fuzzy_where/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,17 @@
FuzzyWhere.configure { |c| c.predicates_file = nil }
end
end
context 'with forbidden predicates_file' do
let(:path) { FIXTURES_PATH.join('forbidden_predicates.yml') }
before do
FuzzyWhere.configure { |c| c.predicates_file = path }
end
it 'should raise FuzzyWhere::ConfigError' do
expect { config.fuzzy_predicate(:some_key) }.to raise_error(FuzzyWhere::ConfigError)
end
after do
FuzzyWhere.configure { |c| c.predicates_file = nil }
end
end
end
end

0 comments on commit 7419680

Please sign in to comment.