Sha256: a9d2f91e6b34a0167d989d228f3a9bedfc54f7a527e01a3b40f5ae7ba178b257

Contents?: true

Size: 506 Bytes

Versions: 1

Compression:

Stored size: 506 Bytes

Contents

require 'spec_helper'
require 'futuroscope/future'
require 'timeout'

module Futuroscope
  describe Future do
    it "will return an instant value" do
      future = Future.new{ :edballs }
      sleep(0.1)

      expect(future.to_sym).to eq(:edballs)
    end

    it "will execute the future in the background and wait for it" do
      future = Future.new{ sleep(0.1); :edballs }

      Timeout::timeout(0.15) do
        sleep(0.1)
        expect(future.to_sym).to eq(:edballs)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
futuroscope-0.0.1 spec/futuroscope/future_spec.rb