var replace = require("../str-replace");
var expect = require("expect.js");

describe("Replace first", function() {

  it("should replace first occurrences", function() {
    expect(replace("a").from("aa").with("e")).to.be("ea");
  });

  it("should replace first occurrences ignoring the case", function() {
    expect(replace("a").ignoringCase().from("AA").with("e")).to.be("eA");
  });

});

describe("Replace all", function() {

  it("should replace all occurrences", function() {
    expect(replace.all("/").from("/home/dir").with("\\")).to.be("\\home\\dir");
  });

  it("should replace all occurrences ignoring the case", function() {
    var replaceAllHouseIgnoringCase = replace.all("house").ignoringCase();
    expect(replaceAllHouseIgnoringCase.from("Many Houses").with("Horse")).to.be("Many Horses");
    expect(replace.all("house").from("Many Houses").with("Horse")).to.be("Many Houses");
  });

});

@@ -101,33 +101,32 @@
 %22, function() %7B%0A
-%0A
   it(%22should rep
@@ -220,33 +220,32 @@
 be(%22ea%22);%0A  %7D);%0A
-%0A
   it(%22should rep
@@ -376,25 +376,24 @@
 eA%22);%0A  %7D);%0A
-%0A
 %7D);%0A%0Adescrib
@@ -422,17 +422,16 @@
 ion() %7B%0A
-%0A
   it(%22sh
@@ -560,17 +560,16 @@
 ;%0A  %7D);%0A
-%0A
   it(%22sh
@@ -894,15 +894,14 @@
 %22);%0A
+
   %7D);%0A
-%0A
 %7D);%0A

Remove useless spacing in the tests