Sha256: c8cc93268a624147115f5355deb00fbdc44822c748ce09c4d9e12e60a75af3c4

Contents?: true

Size: 1001 Bytes

Versions: 43

Compression:

Stored size: 1001 Bytes

Contents

require 'test/unit'
require_relative '../lib/minigl'
include MiniGL

class ResTest < Test::Unit::TestCase
  def setup
    @window = GameWindow.new 800, 600, false
    Res.prefix = File.expand_path(File.dirname(__FILE__)) + '/data'
  end

  def test_tileset
    t1 = Res.tileset :tileset1
    assert_equal 9, t1.length
    assert_equal 32, t1[0].width
    assert_equal 32, t1[0].width
    Res.clear
    t1 = Res.tileset :tileset1, 48, 48
    assert_equal 4, t1.length
    assert_equal 48, t1[0].width
    assert_equal 48, t1[0].width
  end

  def test_dirs_and_separator
    assert_nothing_raised do
      img1 = Res.img :img1
    end

    Res.img_dir = 'img/sub'
    assert_nothing_raised do
      img2 = Res.img :image
    end

    Res.img_dir = 'img'
    Res.separator = '~'
    assert_nothing_raised do
      img3 = Res.img 'sub~image'
    end

    Res.prefix = File.expand_path(File.dirname(__FILE__))
    Res.img_dir = ''
    assert_nothing_raised do
      img4 = Res.img :test
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
minigl-2.5.3 test/res_tests.rb
minigl-2.5.2 test/res_tests.rb
minigl-2.5.1 test/res_tests.rb
minigl-2.4.3 test/res_tests.rb
minigl-2.4.1 test/res_tests.rb
minigl-2.4.0 test/res_tests.rb
minigl-2.3.9 test/res_tests.rb
minigl-2.3.8 test/res_tests.rb
minigl-2.3.7 test/res_tests.rb
minigl-2.3.6 test/res_tests.rb
minigl-2.3.5 test/res_tests.rb
minigl-2.3.4 test/res_tests.rb
minigl-2.3.3 test/res_tests.rb
minigl-2.3.2 test/res_tests.rb
minigl-2.3.1 test/res_tests.rb
minigl-2.3.0 test/res_tests.rb
minigl-2.2.9 test/res_tests.rb
minigl-2.2.8 test/res_tests.rb
minigl-2.2.7 test/res_tests.rb
minigl-2.2.6 test/res_tests.rb