Skip to content

Commit

Permalink
test(pinch_detector): Reverse pinch in/out
Browse files Browse the repository at this point in the history
  • Loading branch information
iberianpig committed Mar 25, 2023
1 parent aa46ae1 commit 9f47ce4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/fusuma/plugin/detectors/pinch_detector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module Detectors
end
end

context "with enough pinch IN event" do
context "with enough pinch OUT event" do
before do
deltas = [
Events::Records::GestureRecord::Delta.new(0, 0, 0, 0, 1.0, 0),
Expand All @@ -68,13 +68,13 @@ module Detectors
it "should detect 3 fingers pinch-in (oneshot/repeat)" do
events = @detector.detect([@buffer])
expect(events[0].record.index.keys.map(&:symbol))
.to eq([:pinch, 3, :in])
.to eq([:pinch, 3, :out])
expect(events[1].record.index.keys.map(&:symbol))
.to eq([:pinch, 3, :in, :update])
.to eq([:pinch, 3, :out, :update])
end
end

context "with enough pinch OUT event" do
context "with enough pinch In event" do
before do
deltas = [
Events::Records::GestureRecord::Delta.new(0, 0, 0, 0, 1.0, 0),
Expand All @@ -85,12 +85,12 @@ module Detectors

events.each { |event| @buffer.buffer(event) }
end
it "should detect 3 fingers pinch-out (oneshot/repeat)" do
it "should detect 3 fingers pinch-in (oneshot/repeat)" do
events = @detector.detect([@buffer])
expect(events[0].record.index.keys.map(&:symbol))
.to eq([:pinch, 3, :out])
.to eq([:pinch, 3, :in])
expect(events[1].record.index.keys.map(&:symbol))
.to eq([:pinch, 3, :out, :update])
.to eq([:pinch, 3, :in, :update])
end
end
end
Expand Down

0 comments on commit 9f47ce4

Please sign in to comment.