Method: Kintama::Context::ClassMethods#should

Defined in:
lib/kintama/context.rb

#should(name_or_matcher, &block) ⇒ Object

Define a test to run in this context. The test name will start with “should ” You can either supply a name and block, or a matcher. In the latter case, a test will be generated using that matcher.



178
179
180
181
182
183
184
185
186
# File 'lib/kintama/context.rb', line 178

def should(name_or_matcher, &block)
  if name_or_matcher.respond_to?(:matches?)
    test("should " + name_or_matcher.description) do
      assert name_or_matcher.matches?(subject), name_or_matcher.failure_message
    end
  else
    test("should " + name_or_matcher, &block)
  end
end