spec/prawn/view_spec.rb in prawn-2.2.2 vs spec/prawn/view_spec.rb in prawn-2.3.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'spec_helper' describe Prawn::View do let(:view_object) { Object.new.tap { |o| o.extend(described_class) } } @@ -39,7 +41,23 @@ allow(view_object).to receive(:document).and_return(doc) view_object.save_as('foo.pdf') expect(doc).to have_received(:render_file) + end + + describe '#respond_to?', issue: 1064 do + subject { view_object.respond_to?(method) } + + context 'when called with an existing method from Prawn::Document' do + let(:method) { :text } + + it { is_expected.to be_truthy } + end + + context 'when called with a non-existing method' do + let(:method) { :non_existing_method } + + it { is_expected.to be_falsey } + end end end