samples: gistifying excel.rb and csv.rb

This commit is contained in:
Andy Meneely
2016-04-11 22:30:32 -04:00
parent bd5e6c92f6
commit 8cd651d5f1
12 changed files with 16 additions and 108 deletions
@@ -108,7 +108,7 @@ cairo: scale([1.0, 1.0])
cairo: rotate([0])
cairo: transform([Matrix])
cairo: translate([-300, -350])
cairo: rounded_rectangle([300, 350, 128.0, 64.0, 0, 0])
cairo: rounded_rectangle([300, 350, 200.0, 100.0, 0, 0])
cairo: clip([])
cairo: translate([0, 0])
cairo: set_source([ImageSurface, 300, 350])
@@ -166,7 +166,7 @@ cairo: scale([1.0, 1.0])
cairo: rotate([0])
cairo: transform([Matrix])
cairo: translate([-300, -535])
cairo: rounded_rectangle([300, 535, 128.0, 64.0, 0, 0])
cairo: rounded_rectangle([300, 535, 200.0, 100.0, 0, 0])
cairo: clip([])
cairo: translate([0, 0])
cairo: set_source([ImageSurface, 300, 535])
@@ -216,8 +216,8 @@ cairo: save([])
cairo: translate([0, 0])
cairo: transform([Matrix])
cairo: rotate([0])
cairo: scale([0.8021390374331551, 0.8032128514056225])
cairo: rounded_rectangle([0, 0, 748.0, 747.0, 0, 0])
cairo: scale([6.0, 6.0])
cairo: rounded_rectangle([0, 0, 100.0, 100.0, 0, 0])
cairo: clip([])
cairo: translate([0, 0])
cairo: render_rsvg_handle([RSVG::Handle, "#thing"])
+7 -10
View File
@@ -4,12 +4,6 @@ require 'pp'
describe 'Squib samples' do
around(:each) do |example|
Dir.chdir(samples_dir) do
example.run
end
end
# This test could use some explanation
# Much of the development of Squib has been sample-driven. Every time I want
# new syntax or feature, I write a sample, get it working, and then write
@@ -42,12 +36,12 @@ describe 'Squib samples' do
autoscale_font/_autoscale_font.rb
basic.rb
cairo_access.rb
csv_import.rb
data/_csv.rb
config_text_markup.rb
custom_config.rb
shapes/_draw_shapes.rb
embed_text.rb
excel.rb
data/_excel.rb
gradients.rb
saves/_hand.rb
hello_world.rb
@@ -63,8 +57,11 @@ describe 'Squib samples' do
it "has not changed for #{sample}", slow: true do
log = StringIO.new
mock_cairo(log)
load sample
overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
full_sample_path = File.expand_path "#{samples_dir}/#{sample}"
Dir.chdir(File.dirname("#{samples_dir}/#{sample}")) do
load full_sample_path
end
# 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