Module: Remockable::Helpers

Extended by:
ActiveSupport::Concern
Included in:
ActiveModel::Helpers, ActiveRecord::Helpers
Defined in:
lib/remockable/helpers.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#attributeObject



27
28
29
# File 'lib/remockable/helpers.rb', line 27

def attribute
  @attribute ||= expected_as_array.first
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
38
# File 'lib/remockable/helpers.rb', line 35

def matches?(actual)
  validate_options!
  super
end

#optionsObject



31
32
33
# File 'lib/remockable/helpers.rb', line 31

def options
  @options ||= expected_as_array.extract_options!
end

#unsupported_optionsObject



40
41
42
# File 'lib/remockable/helpers.rb', line 40

def unsupported_options
  []
end

#valid_optionsObject



44
45
46
# File 'lib/remockable/helpers.rb', line 44

def valid_options
  []
end

#validate_options!Object



48
49
50
51
# File 'lib/remockable/helpers.rb', line 48

def validate_options!
  check_unsupported_options!
  check_valid_options!
end