Sha256: 04902042a0b1803656d50f40c98ab189b1f1ec1d2c7c88109b823602754bcf23

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

module UT
  describe Tile do
    describe '#initialize' do
      context 'without args' do
        its(:glyph) { should == " " }
        its(:foreground) { should == Tile::DEFAULT_FOREGROUND }
        its(:background) { should == Tile::DEFAULT_BACKGROUND }
      end

      context 'with args' do
        subject do
          Tile.new :glyph => "a",
            :foreground => Gosu::Color::RED,
            :background => Gosu::Color::GREEN
        end

        its(:glyph) { should == "a" }
        its(:foreground) { should == Gosu::Color::RED }
        its(:background) { should == Gosu::Color::GREEN }
      end
    end

    describe '#clone' do
      let(:tile) do
        Tile.new :glyph => "a",
                 :foreground => Gosu::Color::RED,
                 :background => Gosu::Color::GREEN
      end
      subject { tile.clone }

      its(:glyph) { should == tile.glyph }
      its(:foreground) { should == tile.foreground }
      its(:background) { should == tile.background }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unicodetiles-1.0.0 spec/tile_spec.rb