Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Squashed commits in order to resolve rmurphey/pull/115

Resolves rmurphey/issues/62

Per @PAkerstrand's provided solution, this commit disallows a user
from returning the result of a logical operator rather than the
operation expression itself.

Resolves rmurphey/issues/62

This commit includes the assertion checking for use of bitwise operators
which was previously left out of the PR commit.

re-add assertion checking for bitwise operator
  • Loading branch information
Jacob M. Roufa committed May 11, 2015
1 parent 6acc9ce commit c26ce62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/app/logicalOperators.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ define([
], function(answers) {
describe('logical operators', function(){
it('you should be able to work with logical or', function() {
expect(answers.or(false, true)).to.be.ok;
expect(answers.or(true, false)).to.be.ok;
expect(answers.or(true, true)).to.be.ok;
expect(answers.or(false, false)).not.to.be.ok;
// the following assertion checks for bitwise operator
expect(answers.or(3, 4)).to.not.eq(7);
});

it('you should be able to work with logical and', function() {
expect(answers.and(false, false)).not.to.be.ok;
expect(answers.and(false, true)).not.to.be.ok;
expect(answers.and(true, false)).not.to.be.ok;
expect(answers.and(true, true)).to.be.ok;
expect(answers.and(false, false)).not.to.be.ok;
// the following assertion checks for bitwise operator
expect(answers.and(3, 4)).to.be.ok;
});
});
Expand Down

0 comments on commit c26ce62

Please sign in to comment.