spreadsheet_architect 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -3
- data/README.md +22 -17
- data/lib/spreadsheet_architect/class_methods/xlsx.rb +0 -2
- data/lib/spreadsheet_architect/utils/xlsx.rb +3 -3
- data/lib/spreadsheet_architect/version.rb +1 -1
- metadata +5 -540
- data/lib/spreadsheet_architect/axlsx_string_width_patch.rb +0 -23
- data/test/dummy_app/Rakefile +0 -7
- data/test/dummy_app/app/assets/config/manifest.js +0 -3
- data/test/dummy_app/app/assets/javascripts/application.js +0 -0
- data/test/dummy_app/app/assets/stylesheets/application.css +0 -3
- data/test/dummy_app/app/controllers/application_controller.rb +0 -3
- data/test/dummy_app/app/controllers/spreadsheets_controller.rb +0 -77
- data/test/dummy_app/app/models/active_model_object.rb +0 -15
- data/test/dummy_app/app/models/application_record.rb +0 -3
- data/test/dummy_app/app/models/custom_columns_method_post.rb +0 -29
- data/test/dummy_app/app/models/custom_post.rb +0 -28
- data/test/dummy_app/app/models/legacy_plain_ruby_object.rb +0 -14
- data/test/dummy_app/app/models/plain_ruby_object.rb +0 -12
- data/test/dummy_app/app/models/post.rb +0 -6
- data/test/dummy_app/app/views/layouts/application.html.erb +0 -14
- data/test/dummy_app/config/application.rb +0 -58
- data/test/dummy_app/config/boot.rb +0 -10
- data/test/dummy_app/config/database.yml +0 -25
- data/test/dummy_app/config/environment.rb +0 -5
- data/test/dummy_app/config/environments/test.rb +0 -41
- data/test/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy_app/config/initializers/inflections.rb +0 -10
- data/test/dummy_app/config/initializers/mime_types.rb +0 -5
- data/test/dummy_app/config/initializers/secret_token.rb +0 -11
- data/test/dummy_app/config/initializers/session_store.rb +0 -8
- data/test/dummy_app/config/initializers/spreadsheet_architect.rb +0 -11
- data/test/dummy_app/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy_app/config/locales/en.yml +0 -5
- data/test/dummy_app/config/routes.rb +0 -6
- data/test/dummy_app/config/secrets.yml +0 -22
- data/test/dummy_app/config.ru +0 -4
- data/test/dummy_app/db/migrate/20170103234524_add_posts.rb +0 -10
- data/test/dummy_app/db/schema.rb +0 -23
- data/test/dummy_app/db/test.sqlite3 +0 -0
- data/test/dummy_app/log/test.log +0 -113964
- data/test/dummy_app/tmp/2.0.1/integration/alt_xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/integration/csv.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/integration/ods.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/integration/xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/kitchen_sink.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/kitchen_sink.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/empty.csv +0 -1
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/ActiveModelObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/empty.csv +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomColumnsMethodPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/empty.csv +0 -1
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/CustomPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/empty.csv +0 -1
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/LegacyPlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/empty.csv +0 -1
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/PlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/data.csv +0 -3
- data/test/dummy_app/tmp/2.0.1/models/Post/data.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/data.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/empty.csv +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/empty.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/empty.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/instances.csv +0 -6
- data/test/dummy_app/tmp/2.0.1/models/Post/instances.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/models/Post/instances.xlsx +0 -0
- data/test/dummy_app/tmp/2.0.1/multi_sheet.ods +0 -0
- data/test/dummy_app/tmp/2.0.1/multi_sheet.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/integration/alt_xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/integration/csv.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/integration/ods.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/integration/xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/kitchen_sink.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/kitchen_sink.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/empty.csv +0 -1
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/ActiveModelObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/empty.csv +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomColumnsMethodPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/empty.csv +0 -1
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/CustomPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/empty.csv +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/LegacyPlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/empty.csv +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/PlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/data.csv +0 -3
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/data.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/data.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/empty.csv +0 -1
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/empty.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/empty.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/instances.csv +0 -6
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/instances.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/models/Post/instances.xlsx +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/multi_sheet.ods +0 -0
- data/test/dummy_app/tmp/3.0.0.pre/multi_sheet.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/integration/alt_xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/integration/csv.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/integration/ods.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/integration/xlsx.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/kitchen_sink.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/kitchen_sink.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/ActiveModelObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomColumnsMethodPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/CustomPost/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/LegacyPlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/PlainRubyObject/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/data.csv +0 -4
- data/test/dummy_app/tmp/axlsx-master/models/Post/data.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/data.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/empty.csv +0 -1
- data/test/dummy_app/tmp/axlsx-master/models/Post/empty.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/empty.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/instances.csv +0 -6
- data/test/dummy_app/tmp/axlsx-master/models/Post/instances.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/models/Post/instances.xlsx +0 -0
- data/test/dummy_app/tmp/axlsx-master/multi_sheet.ods +0 -0
- data/test/dummy_app/tmp/axlsx-master/multi_sheet.xlsx +0 -0
- data/test/integration/application_test.rb +0 -38
- data/test/models/all_models_test.rb +0 -108
- data/test/test_helper.rb +0 -87
- data/test/unit/ods/general_test.rb +0 -121
- data/test/unit/rails/formats_test.rb +0 -15
- data/test/unit/spreadsheet_architect/exceptions_test.rb +0 -195
- data/test/unit/spreadsheet_architect/spreadsheet_architect_test.rb +0 -15
- data/test/unit/spreadsheet_architect/utils/ods_test.rb +0 -58
- data/test/unit/spreadsheet_architect/utils/xlsx_test.rb +0 -114
- data/test/unit/spreadsheet_architect/utils_test.rb +0 -197
- data/test/unit/xlsx/freeze_test.rb +0 -79
- data/test/unit/xlsx/general_test.rb +0 -199
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,38 +0,0 @@
|
|
1
|
-
### FOR RAILS TESTS
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class ApplicationTest < ActionDispatch::IntegrationTest
|
6
|
-
def setup
|
7
|
-
@path = TMP_PATH.join("integration")
|
8
|
-
FileUtils.mkdir_p(@path)
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_csv
|
12
|
-
get '/spreadsheets/csv'
|
13
|
-
assert_response :success
|
14
|
-
|
15
|
-
save_file('integration/test.csv', @response.body)
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_ods
|
19
|
-
get '/spreadsheets/ods'
|
20
|
-
assert_response :success
|
21
|
-
|
22
|
-
save_file('integration/test.ods', @response.body)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_xlsx
|
26
|
-
get '/spreadsheets/xlsx'
|
27
|
-
assert_response :success
|
28
|
-
|
29
|
-
save_file('integration/test.xlsx', @response.body)
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_respond_with
|
33
|
-
get '/spreadsheets/test_respond_with', params: {format: :xlsx}
|
34
|
-
assert_response :success
|
35
|
-
|
36
|
-
save_file('integration/test_respond_with.xlsx', @response.body)
|
37
|
-
end
|
38
|
-
end
|
@@ -1,108 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class AllModelsTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@data = [
|
7
|
-
['row1', 'test1'],
|
8
|
-
[123.456, nil, '123'],
|
9
|
-
[123, Date.today, Time.now]
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
def teardown
|
14
|
-
end
|
15
|
-
|
16
|
-
def set_path(klass)
|
17
|
-
@path = TMP_PATH.join("models/#{klass}")
|
18
|
-
FileUtils.mkdir_p(@path)
|
19
|
-
end
|
20
|
-
|
21
|
-
models = []
|
22
|
-
|
23
|
-
models_folder = File.expand_path('../../dummy_app/app/models', __FILE__)
|
24
|
-
Dir[File.join(models_folder, '*.rb')].each do |filename|
|
25
|
-
klass = filename.split('/').last.gsub('.rb', '').titleize.gsub(' ','').constantize
|
26
|
-
unless [ApplicationRecord].include?(klass)
|
27
|
-
models.push(klass)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
models.each do |klass|
|
32
|
-
instances = 5.times.map{|i|
|
33
|
-
x = (klass == SpreadsheetArchitect ? Post : klass).new
|
34
|
-
x.name = i
|
35
|
-
x.content = i+2
|
36
|
-
x.created_at = Time.now
|
37
|
-
x
|
38
|
-
}
|
39
|
-
|
40
|
-
['csv', 'ods', 'xlsx'].each do |format|
|
41
|
-
|
42
|
-
test ":instances #{klass} #{format}" do
|
43
|
-
set_path(klass)
|
44
|
-
|
45
|
-
method = "to_#{format}"
|
46
|
-
which = klass.respond_to?(method) ? klass : SpreadsheetArchitect
|
47
|
-
|
48
|
-
data = which.send(method, instances: instances)
|
49
|
-
|
50
|
-
save_file("models/#{klass}/instances.#{format}", data)
|
51
|
-
end
|
52
|
-
|
53
|
-
test "Empty :instances #{klass} #{format}" do
|
54
|
-
set_path(klass)
|
55
|
-
|
56
|
-
method = "to_#{format}"
|
57
|
-
which = klass.respond_to?(method) ? klass : SpreadsheetArchitect
|
58
|
-
|
59
|
-
data = which.send(method, instances: [])
|
60
|
-
|
61
|
-
save_file("models/#{klass}/empty.#{format}", data)
|
62
|
-
end
|
63
|
-
|
64
|
-
test ":data #{klass} #{format}" do
|
65
|
-
set_path(klass)
|
66
|
-
|
67
|
-
method = "to_#{format}"
|
68
|
-
which = klass.respond_to?(method) ? klass : SpreadsheetArchitect
|
69
|
-
|
70
|
-
data = which.send(method, data: @data)
|
71
|
-
|
72
|
-
save_file("models/#{klass}/data.#{format}", data)
|
73
|
-
end
|
74
|
-
|
75
|
-
test "Empty :data #{klass} #{format}" do
|
76
|
-
set_path(klass)
|
77
|
-
|
78
|
-
method = "to_#{format}"
|
79
|
-
which = klass.respond_to?(method) ? klass : SpreadsheetArchitect
|
80
|
-
|
81
|
-
data = which.send(method, data: [])
|
82
|
-
|
83
|
-
save_file("models/#{klass}/empty.#{format}", data)
|
84
|
-
end
|
85
|
-
|
86
|
-
if klass.is_a?(ActiveRecord::Base)
|
87
|
-
test "ActiveRecord::Relation" do
|
88
|
-
method = "to_#{format}"
|
89
|
-
|
90
|
-
data = klass.all.send(method)
|
91
|
-
|
92
|
-
save_file("models/#{klass}/active_record_relation.#{format}", data)
|
93
|
-
end
|
94
|
-
|
95
|
-
test "Empty ActiveRecord::Relation" do
|
96
|
-
method = "to_#{format}"
|
97
|
-
|
98
|
-
data = klass.limit(0).send(method)
|
99
|
-
|
100
|
-
save_file("models/#{klass}/empty_active_record_relation.#{format}", data)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
2
|
-
|
3
|
-
require 'pry'
|
4
|
-
|
5
|
-
begin
|
6
|
-
require 'warning'
|
7
|
-
|
8
|
-
Warning.ignore(
|
9
|
-
%r{mail/parsers/address_lists_parser}, ### Hide mail gem warnings
|
10
|
-
)
|
11
|
-
rescue LoadError
|
12
|
-
# Do nothing
|
13
|
-
end
|
14
|
-
|
15
|
-
require 'pry'
|
16
|
-
|
17
|
-
require File.expand_path("../dummy_app/config/environment.rb", __FILE__)
|
18
|
-
|
19
|
-
migration_path = Rails.root.join('db/migrate')
|
20
|
-
if ActiveRecord.gem_version >= ::Gem::Version.new("6.0.0")
|
21
|
-
ActiveRecord::MigrationContext.new(migration_path, ActiveRecord::SchemaMigration).migrate
|
22
|
-
elsif ActiveRecord.gem_version >= ::Gem::Version.new("5.2.0")
|
23
|
-
ActiveRecord::MigrationContext.new(migration_path).migrate
|
24
|
-
else
|
25
|
-
ActiveRecord::Migrator.migrate(migration_path)
|
26
|
-
end
|
27
|
-
|
28
|
-
require "rails/test_help"
|
29
|
-
|
30
|
-
Rails.backtrace_cleaner.remove_silencers!
|
31
|
-
|
32
|
-
class ActiveSupport::TestCase
|
33
|
-
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
34
|
-
fixtures :all
|
35
|
-
end
|
36
|
-
|
37
|
-
require 'minitest-spec-rails' ### for describe blocks
|
38
|
-
|
39
|
-
require 'minitest/reporters'
|
40
|
-
Minitest::Reporters.use!(
|
41
|
-
Minitest::Reporters::DefaultReporter.new,
|
42
|
-
ENV,
|
43
|
-
Minitest.backtrace_filter
|
44
|
-
)
|
45
|
-
|
46
|
-
require 'minitest-spec-rails'
|
47
|
-
|
48
|
-
post_count = Post.count
|
49
|
-
if post_count < 5
|
50
|
-
(5 - post_count).times do |i|
|
51
|
-
Post.create!(name: "foo #{i}", content: "bar #{i}", age: i)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
TMP_PATH = Rails.root.join("../../tmp/")
|
56
|
-
|
57
|
-
### Cleanup old test spreadsheets
|
58
|
-
FileUtils.remove_dir(TMP_PATH, true)
|
59
|
-
FileUtils.mkdir_p(TMP_PATH)
|
60
|
-
|
61
|
-
def save_file(path, file_data)
|
62
|
-
if file_data.is_a?(Axlsx::Package)
|
63
|
-
file_data = file_data.to_stream.read
|
64
|
-
elsif file_data.is_a?(RODF::Spreadsheet)
|
65
|
-
file_data = file_data.bytes
|
66
|
-
end
|
67
|
-
|
68
|
-
path = Rails.root.join("../../tmp/", path)
|
69
|
-
|
70
|
-
FileUtils.mkdir_p(File.dirname(path))
|
71
|
-
|
72
|
-
File.open(TMP_PATH.join(path), "w+b") do |f|
|
73
|
-
f.write file_data
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def parse_ods_spreadsheet(spreadsheet)
|
78
|
-
Nokogiri::XML(spreadsheet.xml)
|
79
|
-
end
|
80
|
-
|
81
|
-
def parse_axlsx_package(package)
|
82
|
-
Nokogiri::XML(package.workbook.worksheets.first.to_xml_string)
|
83
|
-
end
|
84
|
-
|
85
|
-
def parse_axlsx_worksheet(worksheet)
|
86
|
-
Nokogiri::XML(worksheet.to_xml_string)
|
87
|
-
end
|
@@ -1,121 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class OdsGeneralTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
test "multisheet" do
|
6
|
-
test_data = [[1,2,3], [4,5,6], [7,8,9]]
|
7
|
-
|
8
|
-
spreadsheet = Post.to_rodf_spreadsheet
|
9
|
-
spreadsheet = CustomPost.to_rodf_spreadsheet({sheet_name: 'Latest Projects'}, spreadsheet)
|
10
|
-
spreadsheet = SpreadsheetArchitect.to_rodf_spreadsheet({data: test_data, sheet_name: 'Another Sheet'}, spreadsheet)
|
11
|
-
|
12
|
-
save_file("ods/multi_sheet.ods", spreadsheet.bytes)
|
13
|
-
end
|
14
|
-
|
15
|
-
test "kitchen sink" do
|
16
|
-
options = {
|
17
|
-
headers: [
|
18
|
-
['Latest Posts'],
|
19
|
-
['Title','Category','Author','Posted on','Posted At','Earnings']
|
20
|
-
],
|
21
|
-
data: 50.times.map{|i| [i, "foobar-#{i}", 5.4*i, true, Date.today, Time.now]},
|
22
|
-
header_style: {background_color: "000000", color: "FFFFFF", align: :center, font_size: 12, bold: true},
|
23
|
-
row_style: {background_color: nil, color: "000000", align: :left, font_size: 12},
|
24
|
-
sheet_name: 'Kitchen Sink',
|
25
|
-
freeze_headers: true,
|
26
|
-
column_types: [
|
27
|
-
:string,
|
28
|
-
:float,
|
29
|
-
:float,
|
30
|
-
:boolean,
|
31
|
-
:date,
|
32
|
-
:time,
|
33
|
-
nil
|
34
|
-
],
|
35
|
-
}
|
36
|
-
|
37
|
-
# Using Array Data
|
38
|
-
file_data = SpreadsheetArchitect.to_ods(options)
|
39
|
-
|
40
|
-
save_file("ods/kitchen_sink.ods", file_data)
|
41
|
-
end
|
42
|
-
|
43
|
-
describe "column_types" do
|
44
|
-
test "validates provided types" do
|
45
|
-
assert_raise SpreadsheetArchitect::Exceptions::ArgumentError do
|
46
|
-
SpreadsheetArchitect.to_ods(
|
47
|
-
data: [],
|
48
|
-
column_types: [""]
|
49
|
-
)
|
50
|
-
end
|
51
|
-
|
52
|
-
SpreadsheetArchitect.to_ods(
|
53
|
-
data: [],
|
54
|
-
column_types: [:string, :float, :date, :time, :boolean, :hyperlink, nil, ->(x){ :foo }]
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
test "works with Proc types" do
|
59
|
-
url = "https://github.com/westonganger/spreadsheet_architect"
|
60
|
-
|
61
|
-
data = [
|
62
|
-
[1, 2],
|
63
|
-
[1, url],
|
64
|
-
]
|
65
|
-
|
66
|
-
ss = SpreadsheetArchitect.to_rodf_spreadsheet(
|
67
|
-
data: data,
|
68
|
-
column_types: [
|
69
|
-
:string,
|
70
|
-
->(x){ x.to_s.start_with?("http") ? :hyperlink : :string }
|
71
|
-
]
|
72
|
-
)
|
73
|
-
|
74
|
-
doc = parse_ods_spreadsheet(ss)
|
75
|
-
|
76
|
-
cells = doc.xpath("//table:table-cell")
|
77
|
-
hyperlinks = doc.xpath("//text:a")
|
78
|
-
|
79
|
-
assert_equal 4, cells.size
|
80
|
-
assert_equal 1, hyperlinks.size
|
81
|
-
|
82
|
-
cell = cells[3]
|
83
|
-
assert_equal url, cell.text
|
84
|
-
assert_equal url, cell.at_xpath(".//text:a").attributes["href"].value
|
85
|
-
|
86
|
-
save_file("ods/hyperlinks.ods", ss)
|
87
|
-
end
|
88
|
-
|
89
|
-
describe "hyperlinks" do
|
90
|
-
test "shows the text and have the correct attributes" do
|
91
|
-
url = "https://github.com/westonganger/spreadsheet_architect"
|
92
|
-
|
93
|
-
data = [
|
94
|
-
[1,2,3],
|
95
|
-
[1, url, "https://github.com/caxlsx/caxlsx"],
|
96
|
-
]
|
97
|
-
|
98
|
-
ss = SpreadsheetArchitect.to_rodf_spreadsheet(data: data, column_types: [:string, :hyperlink, :string])
|
99
|
-
|
100
|
-
doc = parse_ods_spreadsheet(ss)
|
101
|
-
|
102
|
-
cells = doc.xpath("//table:table-cell")
|
103
|
-
hyperlinks = doc.xpath("//text:a")
|
104
|
-
|
105
|
-
assert_equal 6, cells.size
|
106
|
-
assert_equal 2, hyperlinks.size
|
107
|
-
|
108
|
-
cell = cells[1]
|
109
|
-
assert_equal "2", cell.text
|
110
|
-
assert_equal "2", cell.at_xpath(".//text:a").attributes["href"].value
|
111
|
-
|
112
|
-
cell = cells[4]
|
113
|
-
assert_equal url, cell.text
|
114
|
-
assert_equal url, cell.at_xpath(".//text:a").attributes["href"].value
|
115
|
-
|
116
|
-
save_file("ods/hyperlinks.ods", ss)
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class RailsFormatsTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
[:xlsx, :ods, :csv].each do |format|
|
6
|
-
test "Registers :#{format} mime type" do
|
7
|
-
assert Mime::Type.lookup_by_extension(format)
|
8
|
-
end
|
9
|
-
|
10
|
-
test "Registers :#{format} template handler" do
|
11
|
-
assert ActionController::Renderers::RENDERERS.include?(format.to_sym)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,195 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class SpreadsheetArchitectExceptionsTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
test "ArgumentError" do
|
6
|
-
error = SpreadsheetArchitect::Exceptions::ArgumentError
|
7
|
-
|
8
|
-
assert_raise error do
|
9
|
-
conditional_row_styles = [{}]
|
10
|
-
SpreadsheetArchitect::Utils::XLSX.conditional_styles_for_row(conditional_row_styles, true, true)
|
11
|
-
end
|
12
|
-
|
13
|
-
assert_raise error do
|
14
|
-
conditional_row_styles = [{if: true, unless: true, styles: {}}]
|
15
|
-
SpreadsheetArchitect::Utils::XLSX.conditional_styles_for_row(conditional_row_styles, true, true)
|
16
|
-
end
|
17
|
-
|
18
|
-
assert_raise error do
|
19
|
-
conditional_row_styles = [{if: true, styles: false}]
|
20
|
-
SpreadsheetArchitect::Utils::XLSX.conditional_styles_for_row(conditional_row_styles, true, true)
|
21
|
-
end
|
22
|
-
|
23
|
-
assert_raise error do
|
24
|
-
SpreadsheetArchitect::Utils.get_options({freeze: {rows: 1}, freeze_headers: true}, SpreadsheetArchitect)
|
25
|
-
end
|
26
|
-
|
27
|
-
assert_raise error do
|
28
|
-
SpreadsheetArchitect.to_csv(foo: :bar)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
test "NoDataError" do
|
33
|
-
error = SpreadsheetArchitect::Exceptions::NoDataError
|
34
|
-
|
35
|
-
assert error.new
|
36
|
-
|
37
|
-
assert_raise error do
|
38
|
-
SpreadsheetArchitect.to_csv(headers: [])
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
test "MultipleDataSourcesError" do
|
43
|
-
error = SpreadsheetArchitect::Exceptions::MultipleDataSourcesError
|
44
|
-
|
45
|
-
assert error.new
|
46
|
-
|
47
|
-
assert_raise error do
|
48
|
-
SpreadsheetArchitect.to_csv(data: [], instances: [])
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
test "OptionTypeError" do
|
53
|
-
error = SpreadsheetArchitect::Exceptions::OptionTypeError
|
54
|
-
|
55
|
-
assert error.new(:foobar_option).message
|
56
|
-
assert_raise error do
|
57
|
-
SpreadsheetArchitect.to_csv(data: {})
|
58
|
-
end
|
59
|
-
assert_raise error do
|
60
|
-
SpreadsheetArchitect.to_csv(instances: :foo)
|
61
|
-
end
|
62
|
-
assert_raise error do
|
63
|
-
SpreadsheetArchitect.to_csv(headers: :foo)
|
64
|
-
end
|
65
|
-
assert_raise error do
|
66
|
-
SpreadsheetArchitect.to_csv(header_style: :foo)
|
67
|
-
end
|
68
|
-
assert_raise error do
|
69
|
-
SpreadsheetArchitect.to_csv(row_style: :foo)
|
70
|
-
end
|
71
|
-
assert_raise error do
|
72
|
-
SpreadsheetArchitect.to_csv(column_styles: :foo)
|
73
|
-
end
|
74
|
-
assert_raise error do
|
75
|
-
SpreadsheetArchitect.to_csv(range_styles: :foo)
|
76
|
-
end
|
77
|
-
assert_raise error do
|
78
|
-
SpreadsheetArchitect.to_csv(merges: :foo)
|
79
|
-
end
|
80
|
-
assert_raise error do
|
81
|
-
SpreadsheetArchitect.to_csv(borders: :foo)
|
82
|
-
end
|
83
|
-
assert_raise error do
|
84
|
-
SpreadsheetArchitect.to_csv(column_widths: :foo)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
test "SpreadsheetColumnsNotDefinedError" do
|
89
|
-
error = SpreadsheetArchitect::Exceptions::SpreadsheetColumnsNotDefinedError
|
90
|
-
|
91
|
-
assert_raise ArgumentError do
|
92
|
-
error.new
|
93
|
-
end
|
94
|
-
|
95
|
-
assert error.new(SpreadsheetArchitect)
|
96
|
-
|
97
|
-
class QuickBadClass
|
98
|
-
include SpreadsheetArchitect
|
99
|
-
end
|
100
|
-
|
101
|
-
assert_raise error do
|
102
|
-
QuickBadClass.to_csv(instances: [])
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
test "InvalidColumnError" do
|
107
|
-
error = SpreadsheetArchitect::Exceptions::InvalidColumnError
|
108
|
-
|
109
|
-
assert_raise ArgumentError do
|
110
|
-
error.new
|
111
|
-
end
|
112
|
-
|
113
|
-
assert error.new(:foobar_column)
|
114
|
-
|
115
|
-
assert_raise error do
|
116
|
-
SpreadsheetArchitect.to_xlsx(data: [[1]], column_styles: [{columns: 999}])
|
117
|
-
end
|
118
|
-
|
119
|
-
assert_raise error do
|
120
|
-
SpreadsheetArchitect.to_xlsx(data: [[1]], column_styles: [{columns: 'ZZZ'}])
|
121
|
-
end
|
122
|
-
|
123
|
-
assert_raise error do
|
124
|
-
SpreadsheetArchitect.to_xlsx(data: [[1]], column_styles: [{columns: [999]}])
|
125
|
-
end
|
126
|
-
|
127
|
-
assert_raise error do
|
128
|
-
SpreadsheetArchitect.to_xlsx(data: [[1]], column_styles: [{columns: ('ZZX'..'ZZZ')}])
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
test "InvalidRangeOptionError" do
|
133
|
-
error = SpreadsheetArchitect::Exceptions::InvalidRangeOptionError
|
134
|
-
|
135
|
-
assert_raise ArgumentError do
|
136
|
-
error.new
|
137
|
-
end
|
138
|
-
|
139
|
-
assert error.new(:columns, :bar_opt)
|
140
|
-
assert error.new(:row, :bar_opt)
|
141
|
-
assert error.new(:foo, :bar_opt)
|
142
|
-
|
143
|
-
assert_raise error do
|
144
|
-
SpreadsheetArchitect::Utils::XLSX.range_hash_to_str({columns: :foo}, 1, 1)
|
145
|
-
end
|
146
|
-
|
147
|
-
assert_raise error do
|
148
|
-
SpreadsheetArchitect::Utils::XLSX.range_hash_to_str({rows: :foo}, 1, 1)
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
test "InvalidRangeValue" do
|
153
|
-
error = SpreadsheetArchitect::Exceptions::InvalidRangeValue
|
154
|
-
|
155
|
-
assert_raise error do
|
156
|
-
SpreadsheetArchitect::Utils::XLSX.verify_range("foo:foo", 1)
|
157
|
-
end
|
158
|
-
|
159
|
-
assert_raise error do
|
160
|
-
SpreadsheetArchitect::Utils::XLSX.verify_range("@1:A2", 1)
|
161
|
-
end
|
162
|
-
|
163
|
-
assert_raise error do
|
164
|
-
SpreadsheetArchitect::Utils::XLSX.verify_range("A1:A2", 1)
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
test "InvalidRangeError" do
|
169
|
-
error = SpreadsheetArchitect::Exceptions::InvalidRangeError
|
170
|
-
|
171
|
-
assert_raise ArgumentError do
|
172
|
-
error.new
|
173
|
-
end
|
174
|
-
|
175
|
-
errors = []
|
176
|
-
errors.push error.new(:foo_type, :bar_opt)
|
177
|
-
errors.push error.new(:columns, :bar_opt)
|
178
|
-
errors.push error.new(:rows, :bar_opt)
|
179
|
-
errors.push error.new(:format, :bar_opt)
|
180
|
-
errors.push error.new(:type, :bar_opt)
|
181
|
-
errors.push error.new(:foo_type, :bar_opt)
|
182
|
-
|
183
|
-
assert_equal errors.count, errors.uniq.count
|
184
|
-
assert error.new(:foo_type, :bar_opt)
|
185
|
-
|
186
|
-
assert_raise error do
|
187
|
-
SpreadsheetArchitect::Utils::XLSX.verify_range(:foo, 1)
|
188
|
-
end
|
189
|
-
|
190
|
-
assert_raise error do
|
191
|
-
SpreadsheetArchitect::Utils::XLSX.verify_range("foo", 1)
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class SpreadsheetArchitectTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
test "version accessible by default" do
|
6
|
-
assert_not_nil SpreadsheetArchitect::VERSION
|
7
|
-
end
|
8
|
-
|
9
|
-
test "constants dont change" do
|
10
|
-
x = SpreadsheetArchitect.default_options.to_s
|
11
|
-
SpreadsheetArchitect.to_xlsx(headers: [[1]], data: [[1]], header_style: {b: false}, row_style: {background_color: '000000'})
|
12
|
-
assert_equal(x, SpreadsheetArchitect.default_options.to_s)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|