Skip to content

Commit

Permalink
test: fix hierarchy of the context
Browse files Browse the repository at this point in the history
  • Loading branch information
iberianpig committed Nov 25, 2024
1 parent e1bcbfe commit 98c959c
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions spec/fusuma/plugin/parsers/libinput_gesture_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,42 +121,42 @@ module Parsers
expect(parser.parse(event.call).record.finger).to eq 3
end
end
end

context "with hold gestures" do
before do
@debug_events = <<~EVENTS
context "with hold gestures" do
before do
@debug_events = <<~EVENTS
-event10 GESTURE_HOLD_BEGIN +2.125s 3
event10 GESTURE_HOLD_END +3.274s 3
event10 GESTURE_HOLD_BEGIN +5.573s 4
event10 GESTURE_HOLD_END +6.462s 4 cancelled
EVENTS
.split("\n")
end
EVENTS
.split("\n")
end

let(:event) {
-> {
record = @debug_events.shift
Events::Event.new(tag: "libinput_command_input", record: record)
let(:event) {
-> {
record = @debug_events.shift
Events::Event.new(tag: "libinput_command_input", record: record)
}
}
}

it "has a gesture record" do
expect(parser.parse(event.call).record).to be_a Events::Records::GestureRecord
end
it "has a gesture record" do
expect(parser.parse(event.call).record).to be_a Events::Records::GestureRecord
end

it "has a gesture record that it has a status" do
expect(parser.parse(event.call).record.status).to eq "begin"
expect(parser.parse(event.call).record.status).to eq "end"
expect(parser.parse(event.call).record.status).to eq "begin"
expect(parser.parse(event.call).record.status).to eq "cancelled"
end
it "has a gesture record that it has a status" do
expect(parser.parse(event.call).record.status).to eq "begin"
expect(parser.parse(event.call).record.status).to eq "end"
expect(parser.parse(event.call).record.status).to eq "begin"
expect(parser.parse(event.call).record.status).to eq "cancelled"
end

it "has a gesture record that it has finger num" do
expect(parser.parse(event.call).record.finger).to eq 3
expect(parser.parse(event.call).record.finger).to eq 3
expect(parser.parse(event.call).record.finger).to eq 4
expect(parser.parse(event.call).record.finger).to eq 4
it "has a gesture record that it has finger num" do
expect(parser.parse(event.call).record.finger).to eq 3
expect(parser.parse(event.call).record.finger).to eq 3
expect(parser.parse(event.call).record.finger).to eq 4
expect(parser.parse(event.call).record.finger).to eq 4
end
end
end
end
Expand Down

0 comments on commit 98c959c

Please sign in to comment.