Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/br_danfe/danfe_lib/nfce_lib/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ def x_position
@logo.present? ? 2.2.cm : 0
end

def width_box
@logo.present? ? 4.5.cm : 6.7.cm
end

def cnpj(info)
cnpj = BrDocuments::CnpjCpf::Cnpj.new info
"CNPJ: #{cnpj.valid? ? cnpj.formatted : ''}"
Expand Down
12 changes: 12 additions & 0 deletions spec/br_danfe/cce_lib/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,16 @@
end
end
end

describe 'delegating unknown methods to the underlying Prawn document' do
context 'when the underlying document also does not know the method' do
it 'raises NoMethodError' do
expect { subject.this_method_does_not_exist }.to raise_error(NoMethodError)
end

it 'does not respond to it' do
expect(subject.respond_to?(:this_method_does_not_exist)).to be_falsey
end
end
end
end
12 changes: 12 additions & 0 deletions spec/br_danfe/danfe_lib/nfce_lib/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@

expect("#{base_dir}document#render.pdf").to have_same_content_of file: output_pdf
end

describe 'delegating unknown methods to the underlying Prawn document' do
context 'when the underlying document also does not know the method' do
it 'raises NoMethodError' do
expect { subject.this_method_does_not_exist }.to raise_error(NoMethodError)
end

it 'does not respond to it' do
expect(subject.respond_to?(:this_method_does_not_exist)).to be_falsey
end
end
end
end
12 changes: 12 additions & 0 deletions spec/br_danfe/danfe_lib/nfe_lib/document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,16 @@
end
end
end

describe 'delegating unknown methods to the underlying Prawn document' do
context 'when the underlying document also does not know the method' do
it 'raises NoMethodError' do
expect { subject.this_method_does_not_exist }.to raise_error(NoMethodError)
end

it 'does not respond to it' do
expect(subject.respond_to?(:this_method_does_not_exist)).to be_falsey
end
end
end
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Test support code is exercised by the specs that use it, not covered
# on its own — the coverage gate only applies to product code.
add_filter '/spec/support/'

# Prawn internals monkey-patch, not br_danfe's own logic.
add_filter '/lib/prawn/'
end
end

Expand Down
Loading