Sha256: 1b1f094bcc1d4fc73ad414ef7f8c3ab9f74ce8d281efefe944a249c8889c33b4
Contents?: true
Size: 1.43 KB
Versions: 7
Compression:
Stored size: 1.43 KB
Contents
# encoding: utf-8 class FlexturesHookTest < Test::Unit::TestCase context Flextures::Loader do context ".parse_flextures_options" do context "通常動作" do setup do @ret, @options = Flextures::Loader.parse_flextures_options(:users) end should "指定したテーブル分だけハッシュが返されている" do assert_equal 1, @ret.size end should "ハッシュの中身は読み込み設定のハッシュ" do h = { table: :users, file: :users, loader: :fun } assert_equal h, @ret.first end end context "違うファイルをロードした時" do setup do @ret, @options = Flextures::Loader.parse_flextures_options( :users => :users_another3 ) end should "指定したテーブル分だけハッシュが返されている" do assert_equal 1, @ret.size end should "ハッシュの中身は読み込み設定のハッシュ" do h = { table: :users, file: :users_another3, loader: :fun } assert_equal h, @ret.first end end context "オプション指定があった時" do setup do @ret, @options = Flextures::Loader.parse_flextures_options({ cache: true }, :users) end should "オプションを取り出している" do assert_equal true, @options[:cache] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems