From 784a0dcb90e798859ab24b69d4b8c12c200ed85d Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 31 Mar 2015 21:24:28 -0400 Subject: [PATCH] Updating the regression test --- spec/data/samples/embed_text.rb.txt | 78 ++++++++++++++++++++++++- spec/samples/samples_regression_spec.rb | 2 +- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/spec/data/samples/embed_text.rb.txt b/spec/data/samples/embed_text.rb.txt index 45e9a72..0a7552e 100644 --- a/spec/data/samples/embed_text.rb.txt +++ b/spec/data/samples/embed_text.rb.txt @@ -85,11 +85,35 @@ cairo: stroke([]) cairo: restore([]) cairo: save([]) cairo: set_source_color([:black]) -cairo: translate([0, 300]) +cairo: translate([600, 0]) cairo: rotate([0]) cairo: move_to([0, 0]) pango: font_description=([MockDouble]) -pango: text=(["Justify will :tool: work too :purse: with more words just for fun"]) +pango: text=(["Wrapping multiples: These are 1 :tool::tool::tool: and these are multiple :tool::tool: :tool::tool:"]) +pango: width=([184320]) +pango: height=([307200]) +pango: wrap=([#]) +pango: ellipsize=([#]) +pango: alignment=([#]) +pango: justify=([false]) +pango: spacing=([0]) +cairo: update_pango_layout([MockDouble]) +pango: markup=(["Wrapping multiples: These are 1 :tool::tool::tool: and these are multiple :tool::tool: :tool::tool:"]) +cairo: move_to([0, 0.0]) +cairo: update_pango_layout([MockDouble]) +cairo: show_pango_layout([MockDouble]) +cairo: rounded_rectangle([0, 0, 0, 0, 0, 0]) +cairo: set_source_color([:cyan]) +cairo: set_line_width([2.0]) +cairo: stroke([]) +cairo: restore([]) +cairo: save([]) +cairo: set_source_color([:black]) +cairo: translate([0, 320]) +cairo: rotate([0]) +cairo: move_to([0, 0]) +pango: font_description=([MockDouble]) +pango: text=([":tool:Justify will :tool: work too, and :purse: with more words just for fun"]) pango: width=([184320]) pango: height=([307200]) pango: wrap=([#]) @@ -98,7 +122,7 @@ pango: alignment=([#]) pango: justify=([true]) pango: spacing=([0]) cairo: update_pango_layout([MockDouble]) -pango: markup=(["Justify will :tool: work too :purse: with more words just for fun"]) +pango: markup=([":tool:Justify will :tool: work too, and :purse: with more words just for fun"]) cairo: move_to([0, 0.0]) cairo: update_pango_layout([MockDouble]) cairo: show_pango_layout([MockDouble]) @@ -107,4 +131,52 @@ cairo: set_source_color([:magenta]) cairo: set_line_width([2.0]) cairo: stroke([]) cairo: restore([]) +cairo: save([]) +cairo: set_source_color([:black]) +cairo: translate([200, 320]) +cairo: rotate([0]) +cairo: move_to([0, 0]) +pango: font_description=([MockDouble]) +pango: text=(["Right-aligned works :tool: with :health: and :purse:"]) +pango: width=([184320]) +pango: height=([307200]) +pango: wrap=([#]) +pango: ellipsize=([#]) +pango: alignment=([#]) +pango: justify=([false]) +pango: spacing=([0]) +cairo: update_pango_layout([MockDouble]) +pango: markup=(["Right-aligned works :tool: with :health: and :purse:"]) +cairo: move_to([0, 0.0]) +cairo: update_pango_layout([MockDouble]) +cairo: show_pango_layout([MockDouble]) +cairo: rounded_rectangle([0, 0, 0, 0, 0, 0]) +cairo: set_source_color([:magenta]) +cairo: set_line_width([2.0]) +cairo: stroke([]) +cairo: restore([]) +cairo: save([]) +cairo: set_source_color([:black]) +cairo: translate([400, 320]) +cairo: rotate([0]) +cairo: move_to([0, 0]) +pango: font_description=([MockDouble]) +pango: text=([":tool:Center-aligned works :tool: with :health: and :purse:"]) +pango: width=([184320]) +pango: height=([307200]) +pango: wrap=([#]) +pango: ellipsize=([#]) +pango: alignment=([#]) +pango: justify=([false]) +pango: spacing=([0]) +cairo: update_pango_layout([MockDouble]) +pango: markup=([":tool:Center-aligned works :tool: with :health: and :purse:"]) +cairo: move_to([0, 0]) +cairo: update_pango_layout([MockDouble]) +cairo: show_pango_layout([MockDouble]) +cairo: rounded_rectangle([0, 0, 0, 0, 0, 0]) +cairo: set_source_color([:magenta]) +cairo: set_line_width([2.0]) +cairo: stroke([]) +cairo: restore([]) surface: write_to_png(["_output/embed_00.png"]) diff --git a/spec/samples/samples_regression_spec.rb b/spec/samples/samples_regression_spec.rb index 39ac0fc..50c227d 100644 --- a/spec/samples/samples_regression_spec.rb +++ b/spec/samples/samples_regression_spec.rb @@ -70,7 +70,7 @@ describe "Squib samples" do log = StringIO.new mock_cairo(log) load sample - overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log + # overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log test_file_str = File.open(sample_regression_file(sample), 'r:UTF-8').read expect(log.string).to eq(test_file_str) end