Sha256: ada561ea2d9df5011d3642b699c9dccb16f25e1fcb09076b121895bda5b6f192

Contents?: true

Size: 1.42 KB

Versions: 30

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

require 'test_helper'

module Vedeu

  module EscapeSequences

    describe Mouse do

      let(:described) { Vedeu::EscapeSequences::Mouse }

      describe '.disable_mouse' do
        subject { described.disable_mouse }

        context 'when the mouse is enabled in the configuration' do
          it { subject.must_equal("\e[?9l") }
        end

        context 'when the mouse is not enabled in the configuration' do
          before { Vedeu.config.stubs(:mouse?).returns(false) }

          it { subject.must_equal('') }
        end
      end

      describe '.enable_mouse' do
        subject { described.enable_mouse }

        context 'when the mouse is enabled in the configuration' do
          it { subject.must_equal("\e[?9h") }
        end

        context 'when the mouse is not enabled in the configuration' do
          before { Vedeu.config.stubs(:mouse?).returns(false) }

          it { subject.must_equal('') }
        end
      end

      describe '.mouse_x10_on' do
        it { described.mouse_x10_on.must_equal("\e[?9h") }
      end

      describe '.mouse_x10_off' do
        it { described.mouse_x10_off.must_equal("\e[?9l") }
      end

      describe '.mouse_on' do
        it { described.mouse_on.must_equal("\e[?1000h") }
      end

      describe '.mouse_off' do
        it { described.mouse_off.must_equal("\e[?1000l") }
      end

    end # Mouse

  end # EscapeSequences

end # Vedeu

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
vedeu-0.8.12 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.10 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.9 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.8 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.7 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.6 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.5 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.4 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.3 test/lib/vedeu/esc/mouse_test.rb
vedeu-0.8.2 test/lib/vedeu/esc/mouse_test.rb