Sha256: 6f96890166c32360fd6240a6e1f4553f349dece8bb6d8e21b897e4957a75a090

Contents?: true

Size: 1.23 KB

Versions: 43

Compression:

Stored size: 1.23 KB

Contents

class TestGtkIconTheme < Test::Unit::TestCase
  include GtkTestUtils

  def setup
    @theme = Gtk::IconTheme.default
  end

  def test_choose_icon
    assert_nil(@theme.choose_icon("non-existent", 100))

    icon = @theme.choose_icon("face-cool", 10)
    assert_not_nil(icon)
    assert_match(/face-cool/, icon.filename)

    assert_not_nil(@theme.choose_icon("face-cool", 29, [:use_builtin, :no_svg]))
  end

  def test_contexts
    assert_operator(@theme.contexts, :include?, "MimeTypes")
  end

  class TestIcons < self
    def test_no_argument
      assert_operator(@theme.icons, :include?, "face-cool")
    end

    def test_context
      assert_operator(@theme.icons("Actions"), :include?, "find")
    end
  end

  sub_test_case "#lookup_icon" do
    sub_test_case "icon" do
      test "String" do
        assert_not_nil(@theme.lookup_icon("search",
                                          16, :generic_fallback))
      end

      test "Symbol" do
        assert_not_nil(@theme.lookup_icon("search",
                                          16, :generic_fallback))
      end

      test "Gio::Icon" do
        icon = Gio::ThemedIcon.new("search")
        assert_not_nil(@theme.lookup_icon(icon, 16, :generic_fallback))
      end
    end
  end
end

Version data entries

43 entries across 35 versions & 2 rubygems

Version Path
savant-echo-1.0.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-1.0.4 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
gtk3-3.1.1-x64-mingw32 test/test-gtk-icon-theme.rb
gtk3-3.1.1-x86-mingw32 test/test-gtk-icon-theme.rb
gtk3-3.1.1 test/test-gtk-icon-theme.rb
savant-echo-1.0.1 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-1.0.1 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.91 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.91 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.9 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.9 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.6 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.6 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.5 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.5 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.4 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.4 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.3 bin/alexa-0.1.2-osx/lib/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
savant-echo-0.1.3 bin/packaging/vendor/ruby/2.2.0/gems/gtk3-3.1.0/test/test-gtk-icon-theme.rb
gtk3-3.1.0-x64-mingw32 test/test-gtk-icon-theme.rb