Class: Minitest::MustWonted::Matcher::Awesome

Inherits:
Object
  • Object
show all
Includes:
Assertions
Defined in:
lib/minitest/mustwonted/matcher/awesome.rb

Overview

Provides the awesome, pure logick like matchers

smth.must == smth
smth.must =~ /re/
smth.must > smth
...

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject, flipped) ⇒ Awesome

Returns a new instance of Awesome.



14
15
16
17
18
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 14

def initialize(subject, flipped)
  @subject    = subject
  @flipped    = flipped
  @assertions = 0
end

Instance Attribute Details

#assertionsObject

Returns the value of attribute assertions.



12
13
14
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 12

def assertions
  @assertions
end

#flippedObject

Returns the value of attribute flipped.



12
13
14
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 12

def flipped
  @flipped
end

#subjectObject

Returns the value of attribute subject.



12
13
14
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 12

def subject
  @subject
end

Instance Method Details

#!=(value) ⇒ Object



24
25
26
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 24

def !=(value)
  __call 'equal', true, value, @subject
end

#<(value) ⇒ Object



36
37
38
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 36

def < (value)
  __call 'operator', false, @subject, :<, value
end

#<=(value) ⇒ Object



44
45
46
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 44

def <= (value)
  __call 'operator', false, @subject, :<=, value
end

#==(value) ⇒ Object



20
21
22
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 20

def ==(value)
  __call 'equal', false, value, @subject
end

#=~(regexp) ⇒ Object



28
29
30
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 28

def =~(regexp)
  __call 'match', false, regexp, @subject
end

#>(value) ⇒ Object



32
33
34
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 32

def > (value)
  __call 'operator', false, @subject, :>, value
end

#>=(value) ⇒ Object



40
41
42
# File 'lib/minitest/mustwonted/matcher/awesome.rb', line 40

def >= (value)
  __call 'operator', false, @subject, :>=, value
end