Skip to content

Commit

Permalink
Style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Oct 26, 2020
1 parent c660d1a commit 12eb453
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
6 changes: 2 additions & 4 deletions tests/libyui/menu_hotkeys_1177760_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative "rspec_tmux_tui"

describe "Menu Item" do
bug = "1177760"
bug = "1177760" # https://bugzilla.suse.com/show_bug.cgi?id=1177760
around(:each) do |ex|
@base = "menu_hotkeys_#{bug}"

Expand All @@ -11,9 +11,7 @@

ex.run

if @tui.has_session?
@tui.kill_session
end
@tui.ensure_no_session
end

it "has hotkeys in menu items, boo##{bug}" do
Expand Down
13 changes: 9 additions & 4 deletions tests/libyui/rspec_tmux_tui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def await(pattern)
txt = capture_pane
case txt
when pattern
sleep 0.1 # draw the rest of the screen
return
sleep 0.1 # draw the rest of the screen
return nil
else
sleep sl
end
Expand All @@ -65,12 +65,17 @@ def await(pattern)
def send_keys(keys)
system "tmux", "send-keys", "-t", session_name, keys
end

def has_session?

def has_session? # rubocop:disable Style/PredicateName
# the method name mimics the tmux command
system "tmux", "has-session", "-t", session_name
end

def kill_session
system "tmux", "kill-session", "-t", session_name
end

def ensure_no_session
kill_session if has_session?
end
end
8 changes: 4 additions & 4 deletions tests/libyui/table_sort_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
@base = "table_sort"
@tui = TmuxTui.new_session "#{yast_ncurses} #{__dir__}/#{@base}.rb change-current-item"
ex.run
@tui.kill_session if @tui.has_session?
@tui.ensure_no_session
end

bug = "1165388"
bug = "1165388" # https://bugzilla.suse.com/show_bug.cgi?id=1165388
it "ChangeWidget(_, Cell(row, col)) changes the correct cell, boo##{bug}" do
base = @base + "_cell"
@tui.await(/Table sorting test/)
Expand All @@ -27,9 +27,9 @@
@tui.send_keys "M-C" # &Close
end

bug = "1177145"
bug = "1177145" # https://bugzilla.suse.com/show_bug.cgi?id=1177145
it "ChangeWidget(_, :CurrentItem) activates the correct line, boo##{bug}" do
skip "not fixed yet"
pending "not fixed yet"

base = @base + "_current_item"
@tui.await(/Table sorting test/)
Expand Down

0 comments on commit 12eb453

Please sign in to comment.