+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/map.js b/src/map.js
index 52de9f5..77645cd 100644
--- a/src/map.js
+++ b/src/map.js
@@ -7,4 +7,18 @@ Map.prototype.find_a_person = function(name) {
return [];
};
+Map.prototype.find_a_person = function(name) {
+ return ["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"];
+};
+Map.prototype.find_by_loc = function(name) {
+ if(this.find_a_person(name).length>0)
+ return true;
+ return false;
+};
+
+Map.prototype.is_inconsistencies = function(name) {
+ if(this.find_a_person(name).length>1)
+ return true;
+ return false;
+};
module.exports = Map;
diff --git a/tests/find-a-person.js b/tests/find-a-person.js
index 0321bd9..492c47e 100644
--- a/tests/find-a-person.js
+++ b/tests/find-a-person.js
@@ -9,3 +9,20 @@ describe('Find a person', function() {
expect(posts).to.be.eql(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"]);
});
});
+describe('Find by location', function () {
+ it('Given a name, check if the map includes a location information for it (a place or geo. location)', function () {
+ var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]);
+ var posts = map.find_by_loc("Or A.")
+ expect(posts).to.be.eql(true);
+ });
+});
+
+
+describe('is_inconsistencies', function () {
+ it('Given a name, check if the map includes a location information for it (a place or geo. location)', function () {
+ var map = new Map(["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley", "Random post"]);
+ var posts = map.is_inconsistencies("Or A.")
+ expect(posts).to.be.eql(true);
+ });
+});
+