Class: PositiveOperatorMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/extensions/rhospec/rhospec.rb

Instance Method Summary collapse

Constructor Details

#initialize(actual) ⇒ PositiveOperatorMatcher

Returns a new instance of PositiveOperatorMatcher.



229
230
231
# File 'lib/extensions/rhospec/rhospec.rb', line 229

def initialize(actual)
  @actual = actual
end

Instance Method Details

#<(expected) ⇒ Object



240
241
242
243
244
245
# File 'lib/extensions/rhospec/rhospec.rb', line 240

def <(expected)
  unless @actual < expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to be less than #{expected.pretty_inspect}")
  end
end

#<=(expected) ⇒ Object



247
248
249
250
251
252
# File 'lib/extensions/rhospec/rhospec.rb', line 247

def <=(expected)
  unless @actual <= expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to be less than or equal to #{expected.pretty_inspect}")
  end
end

#==(expected) ⇒ Object



233
234
235
236
237
238
# File 'lib/extensions/rhospec/rhospec.rb', line 233

def ==(expected)
  unless @actual == expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to equal #{expected.pretty_inspect}")
  end
end

#=~(expected) ⇒ Object



268
269
270
271
272
273
# File 'lib/extensions/rhospec/rhospec.rb', line 268

def =~(expected)
  unless @actual =~ expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to match #{expected.pretty_inspect}")
  end
end

#>(expected) ⇒ Object



254
255
256
257
258
259
# File 'lib/extensions/rhospec/rhospec.rb', line 254

def >(expected)
  unless @actual > expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to be greater than #{expected.pretty_inspect}")
  end
end

#>=(expected) ⇒ Object



261
262
263
264
265
266
# File 'lib/extensions/rhospec/rhospec.rb', line 261

def >=(expected)
  unless @actual >= expected
    Expectation.fail_with("Expected #{@actual.pretty_inspect}",
                          "to be greater than or equal to #{expected.pretty_inspect}")
  end
end