Class: NegativeOperatorMatcher

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

Instance Method Summary collapse

Constructor Details

#initialize(actual) ⇒ NegativeOperatorMatcher

Returns a new instance of NegativeOperatorMatcher.



305
306
307
# File 'lib/extensions/rhospec/rhospec.rb', line 305

def initialize(actual)
  @actual = actual
end

Instance Method Details

#<(expected) ⇒ Object



316
317
318
319
320
321
# File 'lib/extensions/rhospec/rhospec.rb', line 316

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

#<=(expected) ⇒ Object



323
324
325
326
327
328
# File 'lib/extensions/rhospec/rhospec.rb', line 323

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

#==(expected) ⇒ Object



309
310
311
312
313
314
# File 'lib/extensions/rhospec/rhospec.rb', line 309

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

#=~(expected) ⇒ Object



344
345
346
347
348
349
# File 'lib/extensions/rhospec/rhospec.rb', line 344

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

#>(expected) ⇒ Object



330
331
332
333
334
335
# File 'lib/extensions/rhospec/rhospec.rb', line 330

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

#>=(expected) ⇒ Object



337
338
339
340
341
342
# File 'lib/extensions/rhospec/rhospec.rb', line 337

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