Sha256: 735d721df457466c9f246d112931e0dc25aa4211b8e80a4a3d0bab11a360f210

Contents?: true

Size: 1.7 KB

Versions: 20

Compression:

Stored size: 1.7 KB

Contents

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

require_relative './lib/wxframe_runner'

class MultilineProofCheckTests < WxRuby::Test::GUITests

  def setup
    super
    @text = Wx::TextCtrl.new(frame_win, name: 'Text', style: Wx::TE_MULTILINE|Wx::TE_RICH|Wx::TE_RICH2)
  end

  def cleanup
    @text.destroy
    super
  end

  attr_reader :text
  alias :text_entry :text

  if Wx.has_feature?(:USE_SPELLCHECK)

    def test_spell_check

      assert_true(text.enable_proof_check(Wx::TextProofOptions.default))
      Wx.get_app.yield
      proof_opts = text.get_proof_check_options
      assert_instance_of(Wx::TextProofOptions, proof_opts)
      assert_true(proof_opts.is_spell_check_enabled) unless Wx::PLATFORM == 'WXGTK'
      assert_false(proof_opts.is_grammar_check_enabled)
      if Wx::PLATFORM != 'WXMSW' || Wx::WXWIDGETS_VERSION >= '3.3'
        assert_true(text.enable_proof_check(Wx::TextProofOptions.disable))
      else
        assert_false(text.enable_proof_check(Wx::TextProofOptions.disable)) # incorrect return value for WXMSW
      end
      Wx.get_app.yield
      proof_opts = text.get_proof_check_options
      assert_instance_of(Wx::TextProofOptions, proof_opts)
      assert_false(proof_opts.is_spell_check_enabled) unless Wx::PLATFORM == 'WXGTK'
      assert_false(proof_opts.is_grammar_check_enabled)
      assert_true(text.enable_proof_check(Wx::TextProofOptions.default.grammar_check(true)))
      Wx.get_app.yield
      proof_opts = text.get_proof_check_options
      assert_true(proof_opts.is_spell_check_enabled) unless Wx::PLATFORM == 'WXGTK'
      assert_true(proof_opts.is_grammar_check_enabled) if Wx::PLATFORM == 'WXOSX'

    end

  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
wxruby3-1.5.0 tests/test_proof_check.rb
wxruby3-1.4.2 tests/test_proof_check.rb
wxruby3-1.4.1 tests/test_proof_check.rb
wxruby3-1.4.0 tests/test_proof_check.rb
wxruby3-1.3.1 tests/test_proof_check.rb
wxruby3-1.3.0 tests/test_proof_check.rb
wxruby3-1.2.1 tests/test_proof_check.rb
wxruby3-1.2.0 tests/test_proof_check.rb
wxruby3-1.1.2 tests/test_proof_check.rb
wxruby3-1.1.1 tests/test_proof_check.rb
wxruby3-1.1.0 tests/test_proof_check.rb
wxruby3-1.0.1 tests/test_proof_check.rb
wxruby3-0.9.8 tests/test_proof_check.rb
wxruby3-0.9.7 tests/test_proof_check.rb
wxruby3-0.9.5 tests/test_proof_check.rb
wxruby3-0.9.4 tests/test_proof_check.rb
wxruby3-0.9.3 tests/test_proof_check.rb
wxruby3-0.9.2 tests/test_proof_check.rb
wxruby3-0.9.1 tests/test_proof_check.rb
wxruby3-0.9.0 tests/test_proof_check.rb