module Guide::ConsistencySpecHelper

Private Instance Methods

expect_implemented_interface(object, interface) click to toggle source
# File lib/guide/consistency_spec_helper.rb, line 20
def expect_implemented_interface(object, interface)
  expect(methods_defined_on(object)).
    to include(*methods_defined_on(interface)),
    "I expected your #{object.class.name} to implement all of the methods on your #{interface.class.name}"
end
methods_defined_on(object) click to toggle source
# File lib/guide/consistency_spec_helper.rb, line 26
def methods_defined_on(object)
  if object.kind_of?(Guide::ViewModel)
    object.guide_view_model_interface_methods
  else
    object.methods - Module.instance_methods
  end.sort
end