Sha256: 0f0422b589c7b7dbbf33c2c69dbde89f2197bccca6e6a885947448fbf62dd30d

Contents?: true

Size: 1.75 KB

Versions: 1

Compression:

Stored size: 1.75 KB

Contents

# Copyright (C) 2013-2014 Masafumi Yokoyama <myokoym@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

require "mireru/window"

class WindowTest < Test::Unit::TestCase
  include MireruTestUtils

  def setup
    @window = Mireru::Window.new([])
  end

  class AddFromFileTest < self
    def test_textview
      file = __FILE__
      stub(Mireru::Widget).create do
        Gtk::TextView.new
      end
      stub(@window).show_all
      @window.add_from_file(file)
      pane = @window.child
      vbox = pane.child2
      scrolled_window = vbox.children[0]
      widget = scrolled_window.child
      assert_kind_of(Gtk::TextView, widget)
    end

    def test_viewport
      file = File.join(fixtures_dir, "nijip.png")
      stub(Mireru::Widget).create do
        Gtk::Image.new
      end
      stub(@window).show_all
      @window.add_from_file(file)
      pane = @window.child
      vbox = pane.child2
      scrolled_window = vbox.children[0]
      view_port = scrolled_window.child
      assert_kind_of(Gtk::Viewport, view_port)
      widget = view_port.child
      assert_kind_of(Gtk::Image, widget)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mireru-0.9.3 test/test-window.rb