From 7900453c97360296faddd66e13cf185854ffa9a4 Mon Sep 17 00:00:00 2001 From: shekharrajak Date: Sun, 4 Jun 2017 14:08:12 +0530 Subject: [PATCH] minor change in tests --- spec/iruby_notebook_spec.rb | 80 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/spec/iruby_notebook_spec.rb b/spec/iruby_notebook_spec.rb index 8b5617c..cf85be2 100644 --- a/spec/iruby_notebook_spec.rb +++ b/spec/iruby_notebook_spec.rb @@ -1,16 +1,14 @@ require File.dirname(__FILE__) + '/spec_helper' -require 'iruby' -require 'iruby' describe LazyHighCharts do - # Tell the name of new JS extension library to highcharts.js - context ".add_extension" do - it "should add extension name to lists" do - LazyHighCharts.add_extension("Hoge") - expect(LazyHighCharts.extension_lists.index("Hoge").nil?).to eq(false) - end - end + # # Tell the name of new JS extension library to highcharts.js + # context ".add_extension" do + # it "should add extension name to lists" do + # LazyHighCharts.add_extension("Hoge") + # expect(LazyHighCharts.extension_lists.index("Hoge").nil?).to eq(false) + # end + # end # Add extension libraries loaded before LazyHighCharts.js context ".add_dependency" do @@ -37,43 +35,43 @@ module LazyHighCharts end - describe '.load_notebook' do - shared_examples 'inline script' do - it 'loads javascript sources as inline script' do - expect(IRuby).to receive(:display) do |rep| - expect(rep).to be_kind_of(IRuby::Display::Representation) - expect(rep.options[:mime]).to eq('application/javascript') + # describe '.load_notebook' do + # shared_examples 'inline script' do + # it 'loads javascript sources as inline script' do + # expect(IRuby).to receive(:display) do |rep| + # expect(rep).to be_kind_of(IRuby::Display::Representation) + # expect(rep.options[:mime]).to eq('application/javascript') - # highcharts.js - expect(rep.object).to match(/this\.highcharts=/) - end - expect(load_notebook).to eq(nil) - end - end + # # highcharts.js + # expect(rep.object).to match(/this\.highcharts=/) + # end + # expect(load_notebook).to eq(nil) + # end + # end - context 'without parameters' do - subject(:load_notebook) { LazyHighCharts.load_notebook } + # context 'without parameters' do + # subject(:load_notebook) { LazyHighCharts.load_notebook } - include_examples 'inline script' - end + # include_examples 'inline script' + # end - context 'given `assets` parameter is `:inline`' do - subject(:load_notebook) { LazyHighCharts.load_notebook(:inline) } + # context 'given `assets` parameter is `:inline`' do + # subject(:load_notebook) { LazyHighCharts.load_notebook(:inline) } - include_examples 'inline script' - end + # include_examples 'inline script' + # end - context 'given `assets` parameter is `:cdn`' do - subject(:load_notebook) { LazyHighCharts.load_notebook(:cdn) } + # context 'given `assets` parameter is `:cdn`' do + # subject(:load_notebook) { LazyHighCharts.load_notebook(:cdn) } - it 'loads javascript sources from cdn' do - expect(IRuby).to receive(:display) do |rep| - expect(rep).to be_kind_of(IRuby::Display::Representation) - expect(rep.options[:mime]).to eq('application/javascript') - expect(rep.object).to include('http://code.highcharts.com/highcharts.js') - end - expect(load_notebook).to eq(nil) - end - end - end + # it 'loads javascript sources from cdn' do + # expect(IRuby).to receive(:display) do |rep| + # expect(rep).to be_kind_of(IRuby::Display::Representation) + # expect(rep.options[:mime]).to eq('application/javascript') + # expect(rep.object).to include('http://code.highcharts.com/highcharts.js') + # end + # expect(load_notebook).to eq(nil) + # end + # end + # end end