Module: OSpec::Expectations

Included in:
Object
Defined in:
lib/ospec/expectations.rb

Instance Method Summary collapse

Instance Method Details

#be_falseObject



33
34
35
# File 'lib/ospec/expectations.rb', line 33

def be_false
  OSpec::BeFalseMatcher.new false
end

#be_kind_of(expected) ⇒ Object



21
22
23
# File 'lib/ospec/expectations.rb', line 21

def be_kind_of expected
  OSpec::BeKindOfMatcher.new expected
end

#be_nilObject



25
26
27
# File 'lib/ospec/expectations.rb', line 25

def be_nil
  OSpec::BeNilMatcher.new nil
end

#be_trueObject



29
30
31
# File 'lib/ospec/expectations.rb', line 29

def be_true
  OSpec::BeTrueMatcher.new true
end

#equal(expected) ⇒ Object



37
38
39
# File 'lib/ospec/expectations.rb', line 37

def equal expected
  OSpec::EqualMatcher.new expected
end

#raise_error(expected) ⇒ Object



41
42
43
# File 'lib/ospec/expectations.rb', line 41

def raise_error expected
  OSpec::RaiseErrorMatcher.new expected
end

#should(matcher = nil) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/ospec/expectations.rb', line 5

def should matcher = nil
  if matcher
    matcher.match self
  else
    OSpec::PositiveOperatorMatcher.new self
  end
end

#should_not(matcher = nil) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/ospec/expectations.rb', line 13

def should_not matcher = nil
  if matcher
    matcher.not_match self
  else
    OSpec::NegativeOperatorMatcher.new self
  end
end