test/unit/layout/test_configuration.rb in thinreports-0.7.7 vs test/unit/layout/test_configuration.rb in thinreports-0.8.0
- old
+ new
@@ -1,46 +1,21 @@
# coding: utf-8
-require 'test/unit/helper'
+require 'test_helper'
-class ThinReports::Layout::TestConfiguration < MiniTest::Unit::TestCase
- include ThinReports::TestHelpers
-
+class Thinreports::Layout::TestConfiguration < Minitest::Test
+ include Thinreports::TestHelper
+
# Alias
- Configuration = ThinReports::Layout::Configuration
-
+ Configuration = Thinreports::Layout::Configuration
+
def setup
- layout = flexmock('layout')
- flexmock(layout).should_receive(:format => flexmock('layout_format'))
-
+ layout = Thinreports::Layout.new data_file('layout_text1.tlf')
@config = Configuration.new(layout)
end
-
- def test_undef_items_method
- refute_respond_to @config, :items
- end
-
- def test_undef_values_method
- refute_respond_to @config, :values
- end
-
- def test_properly_set_init_item_handler
- list_format = flexmock('list_format').should_receive(:type => 's-list').once.mock
- list_config = flexmock('list_config').should_receive(:new).once.mock
-
- flexmock(ThinReports::Core::Shape).
- should_receive(:Configuration).with('s-list').and_return(list_config).once
-
- @config.manager.init_item(list_format)
- end
-
- def test_activate
- list_config = flexmock('list_config').should_receive(:copy).once.mock
- @config.manager.shapes[:foo] = list_config
- @config.activate(:foo)
+ def test_disable_methods
+ assert_raises NoMethodError do
+ @config.values
+ end
end
-
- def test_activate_return_nil_when_unknown_shape_id
- assert_nil @config.activate(:unknown)
- end
-end
\ No newline at end of file
+end