Sha256: 09a6384ea374cd71cc6c18fbcffb732cf6d6d6a79cebb2272e51f63d3b0fa5dd

Contents?: true

Size: 589 Bytes

Versions: 7

Compression:

Stored size: 589 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
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.30.0 lib/capybara/rspec/matchers/spatial_sugar.rb
tdiary-5.1.0 vendor/bundle/gems/capybara-3.29.0/lib/capybara/rspec/matchers/spatial_sugar.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/rspec/matchers/spatial_sugar.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/rspec/matchers/spatial_sugar.rb
capybara-3.29.0 lib/capybara/rspec/matchers/spatial_sugar.rb