diff --git a/test/fixtures/song/with_options.erb b/test/fixtures/song/with_options.erb new file mode 100644 index 00000000..4aff243b --- /dev/null +++ b/test/fixtures/song/with_options.erb @@ -0,0 +1 @@ +<%= @title %> diff --git a/test/render_test.rb b/test/render_test.rb index 915c9182..42a57b47 100644 --- a/test/render_test.rb +++ b/test/render_test.rb @@ -50,6 +50,11 @@ def with_block render { "Clean Sheets" + render(:with_html) } end + def with_options(options) + @title = options[:title] + render + end + private def title "Papertiger" @@ -91,6 +96,7 @@ class RenderTest < Minitest::Spec it { assert_equal "default", SongCell.new(nil).receiving_options } it { assert_equal "fancy", SongCell.new(nil).receiving_options(:fancy) } it { assert_equal "fancy", SongCell.new(nil).call(:receiving_options, :fancy) } + it { assert_equal "A new song\n", SongCell.new(nil).call(:with_options, title: 'A new song') } # doesn't escape HTML. it { assert_equal "

Yew!

", SongCell.new(nil).call(:with_html) }