Skip to content

Commit

Permalink
Proper indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakriti-nith committed May 22, 2018
1 parent 91ebc44 commit 7c31af7
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 74 deletions.
52 changes: 26 additions & 26 deletions spec/adapters/highcharts/display_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,26 +126,26 @@
@chart.chart.options = @opts;
@chart.chart.series_data = @series_dt

@opts_map = {
chart_class: 'map',
chart: {
map: 'custom/europe',
borderWidth: 1
},
@opts_map = {
chart_class: 'map',
chart: {
map: 'custom/europe',
borderWidth: 1
},

title: {
text: 'Nordic countries'
},
title: {
text: 'Nordic countries'
},

subtitle: {
text: 'Demo of drawing all areas in the map, only highlighting partial data'
},
subtitle: {
text: 'Demo of drawing all areas in the map, only highlighting partial data'
},

legend: {
enabled: false
}
}
@series_dt_map = [{
legend: {
enabled: false
}
}
@series_dt_map = [{
name: 'Country',
data: [
['is', 1],
Expand All @@ -165,19 +165,19 @@
}
}]
@map = Daru::View::Plot.new
@map.chart.options = @opts_map;
@map.chart.series_data = @series_dt_map
end
it "should plot HighMap when chart_class is set to map" do
@map.chart.options = @opts_map;
@map.chart.series_data = @series_dt_map
end
it "should plot HighMap when chart_class is set to map" do
@hc.options[:chart_class] = "Map";
expect(@hc.chart.to_html(
@placeholder)
@placeholder)
).to match(/window\.chart_placeholder\s+=\s+new\s+Highcharts.Map/)
end
it "should plot Highstock when chart_class is set to stock" do
@hc.options[:chart_class] = "STock";
expect(@hc.chart.to_html(
@placeholder)
@placeholder)
).to match(/window\.chart_placeholder\s+=\s+new\s+Highcharts.StockChart/)
end
it "should plot HighChart otherwise" do
Expand Down Expand Up @@ -258,16 +258,16 @@
end

describe "#to_html_iruby" do
it "should plot HighMap when chart_class is set to map" do
it "should plot HighMap when chart_class is set to map" do
@hc.options[:chart_class] = "Map";
expect(@hc.chart.to_html_iruby(
@placeholder)
@placeholder)
).to match(/window\.chart_placeholder\s+=\s+new\s+Highcharts.Map/)
end
it "should plot HighStock when chart_class is set to stock" do
@hc.options[:chart_class] = "SToCk";
expect(@hc.chart.to_html_iruby(
@placeholder)
@placeholder)
).to match(/window\.chart_placeholder\s+=\s+new\s+Highcharts.StockChart/)
end
it "should plot HighChart otherwise" do
Expand Down
96 changes: 48 additions & 48 deletions spec/adapters/highcharts/layout_helper_iruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
type: 'arearange'
},
rangeSelector: {
selected: 1
selected: 1
},

title: {
text: 'AAPL Stock Price'
text: 'AAPL Stock Price'
}
}
@series_dt = [
Expand Down Expand Up @@ -67,47 +67,47 @@
@chart.chart.options = @opts;
@chart.chart.series_data = @series_dt

@opts_map = {
@opts_map = {
chart_class: 'map',
chart: {
map: 'custom/europe',
borderWidth: 1
},

title: {
text: 'Nordic countries'
text: 'Nordic countries'
},

subtitle: {
text: 'Demo of drawing all areas in the map, only highlighting partial data'
text: 'Demo of drawing all areas in the map, only highlighting partial data'
},

legend: {
enabled: false
enabled: false
}
}
@series_dt_map = [{
name: 'Country',
data: [
['is', 1],
['no', 1],
['se', 1],
['dk', 1],
['fi', 1]
['is', 1],
['no', 1],
['se', 1],
['dk', 1],
['fi', 1]
],
dataLabels: {
enabled: true,
color: '#FFFFFF',
formatter: 'function () {
if (this.point.value) {
return this.point.name;
}
}'.js_code
enabled: true,
color: '#FFFFFF',
formatter: 'function () {
if (this.point.value) {
return this.point.name;
}
}'.js_code
}
}]
@map = Daru::View::Plot.new
@map.chart.options = @opts_map;
@map.chart.series_data = @series_dt_map
@map.chart.series_data = @series_dt_map
end

context "layout_helper" do
Expand All @@ -118,9 +118,9 @@
@chart.chart)
).to match(/<div id="placeholder">/i)
expect(@map.chart.high_chart_iruby(
"Map",
@placeholder,
@map.chart)
"Map",
@placeholder,
@map.chart)
).to match(/<div id="placeholder">/i)
end

Expand All @@ -131,9 +131,9 @@
@chart.chart)
).to match(/script/i)
expect(@chart.chart.high_chart_iruby(
"Map",
@placeholder,
@map.chart)
"Map",
@placeholder,
@map.chart)
).to match(/script/i)
end
end
Expand Down Expand Up @@ -198,37 +198,37 @@
).to match(/window\.chart_placeholder\s+=\s+new\s+Highcharts.Map/)
end
it "should set correct options" do
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/series\": \[\{ \"name\": \"AAPL Stock Price\"/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/\"data\": \[ \[ 1147651200000,67.79 \]/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/\"title\": \{ \"text\": \"AAPL Stock Price\" \}/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/\"chart\": \{ \"type\": \"arearange\"/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/\"marker\": \{ \"enabled\": true/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
).to match(/\"shadow\": true/)
expect(@chart.chart.high_chart_iruby(
expect(@chart.chart.high_chart_iruby(
"StockChart",
@placeholder,
@chart.chart)
Expand Down Expand Up @@ -302,7 +302,7 @@
@chart_class = "Chart"
@options = {
chart: {
type: "bar"
type: "bar"
},
positioner: "function () { return { x: 0, y: 250 }; }".js_code
}
Expand All @@ -325,7 +325,7 @@
plot_options: {
bar: {
data_labels: {
enabled: true
enabled: true
}
}
}
Expand Down Expand Up @@ -368,19 +368,19 @@
end

describe "#high_map" do
it "should generate valid js code" do
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"chart\": { \"map\": \"custom\/europe\"/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"title\": { \"text\": \"Nordic countries\"/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"legend\": { \"enabled\": false }/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"data\": \[ \[ \"is\",1 \]/)
end
it "should generate valid js code" do
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"chart\": { \"map\": \"custom\/europe\"/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"title\": { \"text\": \"Nordic countries\"/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"legend\": { \"enabled\": false }/)
expect(@map.chart.high_map(
@placeholder, @map.chart)
).to match(/\"data\": \[ \[ \"is\",1 \]/)
end
end
end

0 comments on commit 7c31af7

Please sign in to comment.