diff options
| author | Randy Morgan <[email protected]> | 2011-12-14 15:16:25 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-12-14 15:16:25 +0900 |
| commit | 11ba2147c5be473ead38a25b6c44395e81b4cca0 (patch) | |
| tree | 48c3f820bdc707691b086dc98f8a2fc1f83c8b90 | |
| parent | e2cb2d6ab99203393b202ebf5d5c7563f14a5dd9 (diff) | |
| download | caxlsx-11ba2147c5be473ead38a25b6c44395e81b4cca0.tar.gz caxlsx-11ba2147c5be473ead38a25b6c44395e81b4cca0.zip | |
adding in accessors for core and app members of package #2
| -rw-r--r-- | lib/axlsx/package.rb | 8 | ||||
| -rw-r--r-- | test/tc_package.rb | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 0dc72395..1af5761b 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -4,6 +4,14 @@ module Axlsx # xlsx document including valdation and serialization. class Package + # provides access to the app doc properties for this package + # see App + attr_reader :app + + # provides access to the core doc properties for the package + # see Core + attr_reader :core + # Initializes your package # # @param [Hash] options A hash that you can use to specify the author and workbook for this package. diff --git a/test/tc_package.rb b/test/tc_package.rb index 34682505..e831f52a 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -11,6 +11,16 @@ class TestPackage < Test::Unit::TestCase end + def test_core_accessor + assert_equal(@package.core, @package.instance_values["core"]) + assert_raise(NoMethodError) {@package.core = nil } + end + + def test_app_accessor + assert_equal(@package.app, @package.instance_values["app"]) + assert_raise(NoMethodError) {@package.app = nil } + end + def test_default_objects_are_created assert(@package.instance_values["app"].is_a?(Axlsx::App), 'App object not created') assert(@package.instance_values["core"].is_a?(Axlsx::Core), 'Core object not created') |
