Sha256: 04a704b7d5da13ba59de49e8c24a0dcd5c26f87dc3a0e04df2102e984910a01d
Contents?: true
Size: 1.17 KB
Versions: 11
Compression:
Stored size: 1.17 KB
Contents
module Remarkable module Specs module Matchers class SingleContainMatcher < Remarkable::Base arguments :value, :block => :iterator assertions :is_array?, :included? optional :allow_nil optional :allow_blank optional :values, :splat => true after_initialize :set_after_initialize before_assert do @before_assert = true @subject.instance_eval(&@iterator) if @iterator end protected def included? return true if @subject.include?(@value) @expectation = "#{@value} is not included in #{@subject.inspect}" false end def is_array? return true if @subject.is_a?(Array) @expectation = "subject is a #{subject_name}" false end def default_options { :working => true } end def set_after_initialize @after_initialize = true end end def single_contain(*args, &block) SingleContainMatcher.new(*args, &block).spec(self) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems