From abe810de48da22fbc8e28369f50e2863291fe505 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 5 Sep 2018 22:24:05 -0400 Subject: php: fix doc typo, ruby: add tests --- ruby/test/test_errors.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ruby/test/test_errors.rb (limited to 'ruby/test/test_errors.rb') diff --git a/ruby/test/test_errors.rb b/ruby/test/test_errors.rb new file mode 100644 index 0000000..c196f04 --- /dev/null +++ b/ruby/test/test_errors.rb @@ -0,0 +1,32 @@ +require 'minitest/autorun' +require 'luigi-template' + +class ErrorsTest < MiniTest::Test + def test_unknown_key_error + assert_raises(Luigi::UnknownKeyError) do + Luigi::Template.run('foo%{unknown-key}', { + bar: 'foo', + }) + end + end + + def test_unknown_filter_error + assert_raises(Luigi::UnknownFilterError) do + Luigi::Template.run('foo%{bar | unknown-filter}', { + bar: 'foo', + }) + end + end + + def test_unknown_template_error + assert_raises(Luigi::UnknownTemplateError) do + cache = Luigi::Cache.new({ + foo: 'foo%{bar}', + }) + + cache.run('unknown-template', { + bar: 'foo' + }) + end + end +end -- cgit v1.2.3