Skip to content

Commit

Permalink
Add support for consed and sliced to Sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
olabini committed Feb 27, 2010
1 parent 777173d commit 02e92b9
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions test/sequence_spec.ik
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ SequenceHelper = Origin mimic do(
dropped = macro(@called = true. @callInfo = call. 42)
droppedWhile = macro(@called = true. @callInfo = call. 42)
rejected = macro(@called = true. @callInfo = call. 42)
consed = macro(@called = true. @callInfo = call. 42)
sliced = macro(@called = true. @callInfo = call. 42)
)

describe(Mixins,
Expand Down Expand Up @@ -264,11 +266,31 @@ describe(Mixins,
)

describe("consed",
it("should have tests")
it("should resend the call with all arguments to the result of calling seq",
x = Origin mimic
x mimic!(Mixins Sequenced)
seqObj = SequenceHelper mimic
x mock!(:seq) andReturn(seqObj)

x consed(3) should == 42

seqObj called should be true
seqObj callInfo arguments should == ['3]
)
)

describe("sliced",
it("should have tests")
it("should resend the call with all arguments to the result of calling seq",
x = Origin mimic
x mimic!(Mixins Sequenced)
seqObj = SequenceHelper mimic
x mock!(:seq) andReturn(seqObj)

x sliced(3) should == 42

seqObj called should be true
seqObj callInfo arguments should == ['3]
)
)
)
)
Expand Down Expand Up @@ -992,4 +1014,8 @@ describe(Sequence,
describe("Cons",
it("should have tests")
)

describe("Slice",
it("should have tests")
)
)

0 comments on commit 02e92b9

Please sign in to comment.