From cec44f1c5710922a9016aa1ce60ec8948e69a893 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 27 Oct 2015 00:32:23 -0400 Subject: [PATCH] Shamelessly poach the last few coverage lines. --- spec/args/draw_spec.rb | 6 ++++++ spec/card_spec.rb | 11 +++++++++++ spec/conf_spec.rb | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 spec/card_spec.rb diff --git a/spec/args/draw_spec.rb b/spec/args/draw_spec.rb index 69ed292..9049403 100644 --- a/spec/args/draw_spec.rb +++ b/spec/args/draw_spec.rb @@ -60,6 +60,12 @@ describe Squib::Args::Draw do expect(draw).to have_attributes( cap: [Cairo::LINE_CAP_SQUARE] ) end + it 'converts line join' do + args = {join: 'round'} + draw.load! args + expect(draw).to have_attributes( join: [Cairo::LINE_JOIN_ROUND] ) + end + it 'allows fill_first stroke_strategy' do args = {stroke_strategy: :FILL_first} draw.load! args diff --git a/spec/card_spec.rb b/spec/card_spec.rb new file mode 100644 index 0000000..14e0ebf --- /dev/null +++ b/spec/card_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' +require 'squib/card' + +describe Squib::Card do + it 'logs fatal for unknown backend' do + deck = OpenStruct.new(dir: '.', prefix: '', count_format: '%02d', backend: 'broken robots') + + expect(Squib::logger).to receive(:fatal).with("Back end not recognized: 'broken robots'") + expect { Squib::Card.new(deck, 100, 100, 0) }.to raise_error SystemExit + end +end \ No newline at end of file diff --git a/spec/conf_spec.rb b/spec/conf_spec.rb index c7c619f..87295aa 100644 --- a/spec/conf_spec.rb +++ b/spec/conf_spec.rb @@ -31,4 +31,9 @@ describe Squib::Conf do Squib::Conf.load conf('unrecognized.yml') end + it 'helps Andy get full coverage with a test on to_s' do + conf = Squib::Conf.load conf('empty.yml') + expect(conf.to_s).to start_with 'Conf: ' + end + end