summaryrefslogtreecommitdiffhomepage
path: root/test/drawing/tc_scatter_series.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
committerGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
commit083c4c6d62011cd88966d608b0c6bb736f300a0c (patch)
treeb5ceb9b3a32c4130d84c3075966b4033bf32a118 /test/drawing/tc_scatter_series.rb
parent6752225bbb8a9eec905ec02a98f1a25a309c404a (diff)
downloadcaxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.tar.gz
caxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.zip
Use Ruby 1.9 hash syntax (non-production code)
Diffstat (limited to 'test/drawing/tc_scatter_series.rb')
-rw-r--r--test/drawing/tc_scatter_series.rb38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/drawing/tc_scatter_series.rb b/test/drawing/tc_scatter_series.rb
index a550271b..26ed01ea 100644
--- a/test/drawing/tc_scatter_series.rb
+++ b/test/drawing/tc_scatter_series.rb
@@ -5,9 +5,9 @@ require 'tc_helper'
class TestScatterSeries < Test::Unit::TestCase
def setup
p = Axlsx::Package.new
- @ws = p.workbook.add_worksheet :name => "hmmm"
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "Scatter Chart"
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "exponents", :color => 'FF0000', :smooth => true
+ @ws = p.workbook.add_worksheet name: "hmmm"
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "Scatter Chart"
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "exponents", color: 'FF0000', smooth: true
end
def test_initialize
@@ -15,36 +15,36 @@ class TestScatterSeries < Test::Unit::TestCase
end
def test_smoothed_chart_default_smoothing
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "Smooth Chart", :scatter_style => :smoothMarker
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "smoothed exponents"
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "Smooth Chart", scatter_style: :smoothMarker
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "smoothed exponents"
assert(@series.smooth, "series is smooth by default on smooth charts")
end
def test_unsmoothed_chart_default_smoothing
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "Unsmooth Chart", :scatter_style => :line
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "unsmoothed exponents"
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "Unsmooth Chart", scatter_style: :line
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "unsmoothed exponents"
refute(@series.smooth, "series is not smooth by default on non-smooth charts")
end
def test_explicit_smoothing
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "Unsmooth Chart, Smooth Series", :scatter_style => :line
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "smoothed exponents", :smooth => true
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "Unsmooth Chart, Smooth Series", scatter_style: :line
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "smoothed exponents", smooth: true
assert(@series.smooth, "series is smooth when overriding chart default")
end
def test_explicit_unsmoothing
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "Smooth Chart, Unsmooth Series", :scatter_style => :smoothMarker
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "unsmoothed exponents", :smooth => false
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "Smooth Chart, Unsmooth Series", scatter_style: :smoothMarker
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "unsmoothed exponents", smooth: false
refute(@series.smooth, "series is not smooth when overriding chart default")
end
def test_ln_width
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => "ln width", :scatter_style => :line
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :title => "ln_width"
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: "ln width", scatter_style: :line
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], title: "ln_width"
@series.ln_width = 12_700
assert_equal(12_700, @series.ln_width, 'line width assigment is allowed')
@@ -61,22 +61,22 @@ class TestScatterSeries < Test::Unit::TestCase
end
def test_false_show_marker
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => 'Smooth Chart', :scatter_style => :smoothMarker
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9]
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: 'Smooth Chart', scatter_style: :smoothMarker
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9]
assert(@series.show_marker, 'markers are enabled for marker-related styles')
end
def test_true_show_marker
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => 'Line chart', :scatter_style => :line
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9]
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: 'Line chart', scatter_style: :line
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9]
refute(@series.show_marker, 'markers are disabled for markerless scatter styles')
end
def test_marker_symbol
- @chart = @ws.add_chart Axlsx::ScatterChart, :title => 'Line chart', :scatter_style => :line
- @series = @chart.add_series :xData => [1, 2, 4], :yData => [1, 3, 9], :marker_symbol => :diamond
+ @chart = @ws.add_chart Axlsx::ScatterChart, title: 'Line chart', scatter_style: :line
+ @series = @chart.add_series xData: [1, 2, 4], yData: [1, 3, 9], marker_symbol: :diamond
assert_equal(:diamond, @series.marker_symbol, 'series could have own custom marker symbol')
end