require 'spec_helper'

describe "RoLambda.new('a lamb')" do
  let(:o) do
    RoLamb.new('a lamb') do
    end
  end

  it :inspect do
    result = o.send(:"inspect")
    Out.out result
    expect(result).to match(%r{a\slamb})
  end

  it "ro_try until RoLambda can raise error" do
    expect do
      ro_try(0.1, until: RoLamb.new { File.exist?('foo/bar.roro/wwww/www') })
    end.to raise_error(Timeout::Error)
  end

  it "ro_try until RoLambda can work well" do
    expect do
      ro_try(1, until: RoLamb.new { File.exist?(__FILE__) })
    end
  end
end
