Sha256: 028d4c3402a5fcb031c3efb612770c906b6c87d3707932b02a2b7b25616bc14c

Contents?: true

Size: 1.67 KB

Versions: 11

Compression:

Stored size: 1.67 KB

Contents

require_relative "../../helper.rb"

describe Gosu::Font do
  before :each do
    $window = Gosu::Window.new 16, 16, false
  end
  let(:subject) { described_class.new $window, Gosu::default_font_name, 20 }
  let(:shader) { Ashton::Shader.new }

  describe "draw" do
    it "should pass parameters through normally, without a hash" do
      mock(subject).draw_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7

      subject.draw "bleh", 1, 2, 3, 4, 5, 6, 7
    end

    it "should pass parameters through normally, without :shader in the hash" do
      mock(subject).draw_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7

      subject.draw "bleh", 1, 2, 3, 4, 5, 6, 7, shader: shader
    end

    it "should use the shader if supplied" do
      mock(shader) do |m|
        m.enable 3
        m.disable 3
      end
      mock(subject).draw_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7

      subject.draw "bleh", 1, 2, 3, 4, 5, 6, 7, shader: shader
    end
  end

  describe "draw_rel" do
    it "should pass parameters through normally, without a hash" do
      mock(subject).draw_rel_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9

      subject.draw_rel "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9
    end

    it "should pass parameters through normally, without :shader in the hash" do
      mock(subject).draw_rel_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9

      subject.draw_rel "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9, shader: shader
    end

    it "should use the shader if supplied" do
      mock(shader) do |m|
        m.enable 3
        m.disable 3
      end
      mock(subject).draw_rel_without_hash "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9

      subject.draw_rel "bleh", 1, 2, 3, 4, 5, 6, 7, 8, 9, shader: shader
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
danabr75-ashton-0.1.5 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.6 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.5 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.4 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.3 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.2 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.1 spec/ashton/gosu_ext/font_spec.rb
ashton-0.1.0 spec/ashton/gosu_ext/font_spec.rb
ashton-0.0.4alpha spec/ashton/gosu_ext/font_spec.rb
ashton-0.0.3alpha spec/ashton/gosu_ext/font_spec.rb
ashton-0.0.2alpha spec/ashton/gosu_ext/font_spec.rb