Sha256: c86ccc304b5e9ce6a573b6fa9b898e522601add4341f79f93ded8a22233bacf3

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

require_relative './lib/wxapp_runner'

class AppTraitsTests < Test::Unit::TestCase

  def test_traits
    traits = Wx.get_app.get_traits
    assert_not_nil(traits)
    assert_kind_of(Wx::AppTraits, traits)
    port_id, ver_major, ver_minor, ver_micro = traits.get_toolkit_version
    port = case port_id
           when Wx::PortId::PORT_GTK; 'WXGTK'
           when Wx::PortId::PORT_MAC; 'WXOSX'
           when Wx::PortId::PORT_MSW; 'WXMSW'
           else
             nil
           end
    assert_equal(Wx::PLATFORM, port)
    assert_true(Wx::PlatformInfo.instance.check_toolkit_version(ver_major, ver_minor, ver_micro))

    std_paths = traits.get_standard_paths
    assert_not_nil(std_paths)
    assert_kind_of(Wx::StandardPaths, std_paths)
    assert_not_empty(std_paths.config_dir)
    assert_not_empty(std_paths.data_dir)
    assert_not_empty(std_paths.documents_dir)
    assert_not_empty(std_paths.app_documents_dir)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wxruby3-0.9.7-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.5-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.4-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.3-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.2-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.1-x64-mingw-ucrt tests/test_app_traits.rb
wxruby3-0.9.0-x64-mingw-ucrt tests/test_app_traits.rb