 
 describe "Model.apply", ->
   it "Applies given sync stream of functions to the Model", ->
-    b = lib.Model(1)
+    b = Model(1)
     values = collect(b)
     b.apply(Bacon.fromArray([twice, twice, twice]))
     expect(values).to.deep.equal([1, 2, 4, 8])
   it "Applies given async stream of functions to the Model", (done) ->
-    b = lib.Model(1)
+    b = Model(1)
     b.onValue (val) ->
       if val == 2 then done()
     b.apply Bacon.fromBinder (sink) ->

    engine.set("V8")
    expect(collect(car)).to.deep.equal([{ engine: "V8" }])
  it "supports dot notation (like '.engine.cylinders')", ->
    car = lib.Model({ brand: "Ford", engine: { cylinders: 8} })
    cylinders = car.lens ".engine.cylinders"
    expect(collect(cylinders)).to.deep.equal([8])
    cylinders.set(12)


describe "Model.addSource", ->
  it "connects new input stream", ->
    b = Model()
    values = collect(b)
    b.addSource(Bacon.once("wat"))
    expect(values).to.deep.equal(["wat"])
  it "returns stream of values from other sources", ->
    b = Model()
    values = collect(b)
    otherValues = collect(b.addSource(Bacon.once("wat")))
    b.set("lol")
    expect(values).to.deep.equal(["wat", "lol"])
    expect(otherValues).to.deep.equal(["lol"])
  it "accepts initial value from a Property", ->
    b = Model()
    b.addSource(Bacon.constant("wat"))
    values = collect(b)
    expect(values).to.deep.equal(["wat"])
  it "ignores duplicates from input", ->
    b = Model()
    values = collect(b)
    b.addSource(Bacon.fromArray(["wat", "wat"]))
    expect(values).to.deep.equal(["wat"])
  it "ignores duplicates from input with init value", ->
    b = Model("wat")
    values = collect(b)
    b.addSource(Bacon.fromArray(["wat", "wat"]))
    expect(values).to.deep.equal(["wat"])

describe "Model.bind", ->
  it "binds two bindings 2 ways", ->
    a = Model()
    b = Model()
    a.bind(b)
    v_a = collect(a)
    v_b = collect(b)
