diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/lib/gitlab/relative_positioning/range_spec.rb | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/lib/gitlab/relative_positioning/range_spec.rb')
-rw-r--r-- | spec/lib/gitlab/relative_positioning/range_spec.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/lib/gitlab/relative_positioning/range_spec.rb b/spec/lib/gitlab/relative_positioning/range_spec.rb index c3386336493..da1f0166d5d 100644 --- a/spec/lib/gitlab/relative_positioning/range_spec.rb +++ b/spec/lib/gitlab/relative_positioning/range_spec.rb @@ -3,8 +3,10 @@ require 'spec_helper' RSpec.describe Gitlab::RelativePositioning::Range do - item_a = OpenStruct.new(relative_position: 100, object: :x, positioned?: true) - item_b = OpenStruct.new(relative_position: 200, object: :y, positioned?: true) + position_struct = Struct.new(:relative_position, :object, :positioned?) + + item_a = position_struct.new(100, :x, true) + item_b = position_struct.new(200, :y, true) before do allow(item_a).to receive(:lhs_neighbour) { nil } @@ -90,12 +92,12 @@ RSpec.describe Gitlab::RelativePositioning::Range do end describe '#cover?' do - item_c = OpenStruct.new(relative_position: 150, object: :z, positioned?: true) - item_d = OpenStruct.new(relative_position: 050, object: :w, positioned?: true) - item_e = OpenStruct.new(relative_position: 250, object: :r, positioned?: true) - item_f = OpenStruct.new(positioned?: false) - item_ax = OpenStruct.new(relative_position: 100, object: :not_x, positioned?: true) - item_bx = OpenStruct.new(relative_position: 200, object: :not_y, positioned?: true) + item_c = position_struct.new(150, :z, true) + item_d = position_struct.new(050, :w, true) + item_e = position_struct.new(250, :r, true) + item_f = position_struct.new(positioned?: false) + item_ax = position_struct.new(100, :not_x, true) + item_bx = position_struct.new(200, :not_y, true) where(:lhs, :rhs, :item, :expected_result) do [ |