Relish suggests the following...
expect(actual).to be <  expected
However if I try...
 x.rand(10)
 expect(x).to be < 11 
full spec
Then(/^I find each world produces just up to (\d+) fighters per turn and no higher$/) do |arg1|
    test = Planet.new
    test.production.each_index do |ndx|
       expect(test.production[ndx]).to be < 11
    end
  end
I'll get
undefined method `<' for #<RSpec::Matchers::BuiltIn::BePredicate:0x0000000268a3b0> (NoMethodError)
What is the current proper syntax to use expect in a less than comparison?
Syntax looks good. I would first make a very small simple spec, independent of your code to see if your setup works. For example (it should fail btw ;):
describe 'test' do
  it 'works' do
    expect(2).to be < 1
  end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With