Sha256: d1d04feff835544f5266bf9e24f186a080cfd139514d50cd1c8d2cb51ea8866a

Contents?: true

Size: 608 Bytes

Versions: 45

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module RSpecMatchers
    module SpatialSugar
      def above(el)
        options[:above] = el
        self
      end

      def below(el)
        options[:below] = el
        self
      end

      def left_of(el)
        options[:left_of] = el
        self
      end

      def right_of(el)
        options[:right_of] = el
        self
      end

      def near(el)
        options[:near] = el
        self
      end

    private

      def options
        # (@args.last.is_a?(Hash) ? @args : @args.push({})).last
        @kw_args
      end
    end
  end
end

Version data entries

45 entries across 34 versions & 5 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/rspec/matchers/spatial_sugar.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/capybara-3.40.0/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.40.0 lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.39.2 lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.39.1 lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.39.0 lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.38.0 lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.37.1 lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.37.0 lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/capybara-3.36.0/lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/rspec/matchers/spatial_sugar.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/rspec/matchers/spatial_sugar.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.36.0 lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/capybara-3.35.3/lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/capybara-3.35.3/lib/capybara/rspec/matchers/spatial_sugar.rb