diff --git a/lib/daru/view/adapters/datatables.rb b/lib/daru/view/adapters/datatables.rb index bb4ec2a..cec4a2c 100644 --- a/lib/daru/view/adapters/datatables.rb +++ b/lib/daru/view/adapters/datatables.rb @@ -1,4 +1,3 @@ -require 'daru/data_tables' require 'daru' require 'securerandom' require 'erb' @@ -59,13 +58,13 @@ module DatatablesAdapter # table2 = Daru::View::Table.new(df_sale_exp, options2) # table3 = Daru::View::Table.new(df_sale_exp) def init_table(data=[], options={}, _user_options={}) - @table = Daru::DataTables::DataTable.new(data, options) + @table = Daru::View::DataTable.new(data, options) @table end # @return [String] returns code of the dependent JS and CSS file(s) def init_script - Daru::DataTables.init_script + Daru::View::DataTables.init_script end # @param table [Daru::DataTables::DataTable] table object to access @@ -117,7 +116,7 @@ def generate_html(table) # table = Daru::View::Table.new(data, options) # table.init_iruby def init_iruby - Daru::DataTables.init_iruby + Daru::View::DataTables.init_iruby end end end diff --git a/spec/adapters/datatables_spec.rb b/spec/adapters/datatables_spec.rb index 3aff3a5..abc769a 100644 --- a/spec/adapters/datatables_spec.rb +++ b/spec/adapters/datatables_spec.rb @@ -18,20 +18,20 @@ let(:table_dv) { Daru::View::Table.new(@data_vec1, @options) } describe "initialization Tables" do - it "Table class must be Daru::DataTables::DataTable" do - expect(Daru::View::Table.new.table).to be_a Daru::DataTables::DataTable + it "Table class must be Daru::View::DataTable" do + expect(Daru::View::Table.new.table).to be_a Daru::View::DataTable end - it "Table class must be Daru::DataTables::DataTable when data objects" \ + it "Table class must be Daru::View::DataTable when data objects" \ " are of class Array" do - expect(table_string_array.table).to be_a Daru::DataTables::DataTable + expect(table_string_array.table).to be_a Daru::View::DataTable expect(table_string_array.data).to eq string_array expect(table_string_array.options).to eq options end - it "Table class must be Daru::DataTables::DataTable when data objects" \ + it "Table class must be Daru::View::DataTable when data objects" \ " are of class Array of Arrays" do - expect(table_array.table).to be_a Daru::DataTables::DataTable + expect(table_array.table).to be_a Daru::View::DataTable expect(table_array.data).to eq data_array expect(table_array.options).to eq options end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e645619..8245726 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,7 @@ require 'rspec' require 'simplecov' require 'daru/view' +require 'daru/data_tables' require 'daru' require 'coveralls' require 'simplecov-console' diff --git a/spec/table_spec.rb b/spec/table_spec.rb index 3785c9e..0ef93be 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -70,14 +70,14 @@ it 'daru-data_tables table using DataFrame' do expect(table_df).to be_a Daru::View::Table - expect(table_df.table).to be_a Daru::DataTables::DataTable + expect(table_df.table).to be_a Daru::View::DataTable expect(table_df.options).to eq options expect(table_df.data).to eq df end it 'daru-data_tables table using Vector' do expect(table_dv).to be_a Daru::View::Table - expect(table_dv.table).to be_a Daru::DataTables::DataTable + expect(table_dv.table).to be_a Daru::View::DataTable expect(table_dv.options).to eq options expect(table_dv.data).to eq dv end