From 1c63b2653ef9e838b9b48ae8a955b57a3062c9d8 Mon Sep 17 00:00:00 2001 From: Muthu Kumar Date: Sun, 8 Apr 2018 10:03:20 +0530 Subject: [PATCH] [tests] Updated spec to API change --- spec/SelectSpec.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/SelectSpec.js b/spec/SelectSpec.js index e237764..5f8966e 100644 --- a/spec/SelectSpec.js +++ b/spec/SelectSpec.js @@ -8,10 +8,10 @@ describe("Select", () => { it("Should return 'Is 10'", () => { const a = 10; - const result = Select(a) - .for(a > 10, () => 'Greater than 10') - .for(a < 10, () => 'Lesser than 10') - .for(a === 10, () => `Is 10`); + const result = new Select(a) + .for(x => x > 10, () => 'Greater than 10') + .for(x => x < 10, () => 'Lesser than 10') + .for(x => x === 10, () => `Is 10`); expect(result.resolve()).toBe(`Is 10`); }); @@ -19,10 +19,10 @@ describe("Select", () => { it("Should return 'Less than 10'", () => { const a = 1; - const result = Select(a) - .for(a > 10, () => 'Greater than 10') - .for(a < 10, () => 'Lesser than 10') - .for(a === 10, () => `Is 10`); + const result = new Select(a) + .for(x => x > 10, () => 'Greater than 10') + .for(x => x < 10, () => 'Lesser than 10') + .for(x => x === 10, () => `Is 10`); expect(result.resolve()).toBe('Lesser than 10'); }); @@ -30,10 +30,10 @@ describe("Select", () => { it("Should return 'Greater than 10'", () => { const a = 100; - const result = Select(a) - .for(a > 10, () => 'Greater than 10') - .for(a < 10, () => 'Lesser than 10') - .for(a === 10, () => `Is 10`); + const result = new Select(a) + .for(x => x > 10, () => 'Greater than 10') + .for(x => x < 10, () => 'Lesser than 10') + .for(x => x === 10, () => `Is 10`); expect(result.resolve()).toBe('Greater than 10'); });