   it "merges two streams and ends when both are exhausted", ->
     expectStreamEvents( 
       ->
-        left = repeat(1, [1, error(), 2, 3]).take(3)
-        right = repeat(10, [4, 5, 6]).take(3)
+        left = series(1, [1, error(), 2, 3])
+        right = series(10, [4, 5, 6])
         left.merge(right)
       [1, error(), 2, 3, 4, 5, 6])
   it "respects subscriber return value", ->

  it "combines properties by applying the combinator function to values", ->
    expectPropertyEvents(
      ->
        stream = repeat(1, [[1]]).take(1)
        Bacon.combineWith([stream, Bacon.constant([2]), Bacon.constant([3])], ".concat")
      [[1, 2, 3]])


    expectStreamEvents(
      ->
        Bacon.mergeAll([
          series(3, [1, 2])
          series(3, [3, 4]).delay(t(1))
          series(3, [5, 6]).delay(t(2))])
      [1, 3, 5, 2, 4, 6])

describe "Property.sampledBy", -> 
  it "samples property at events, resulting to EventStream", ->
    expectStreamEvents(
      ->
        prop = series(2, [1, 2]).toProperty()
        stream = repeat(3, ["troll"]).take(4)
        prop.sampledBy(stream)
      [1, 2, 2, 2])
  it "includes errors from both Property and EventStream", ->
    expectStreamEvents(
      ->
        prop = series(2, [error(), 2]).toProperty()
        stream = series(3, [error(), "troll"])
        prop.sampledBy(stream)
      [error(), error(), 2])
  it "ends when sampling stream ends", ->
