Skip to content

Commit

Permalink
Fixed broken specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
benquarmby committed Aug 29, 2015
1 parent d210f32 commit 215451a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
22 changes: 16 additions & 6 deletions specifications/JSLintNet.Specifications/JSLintContextUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,36 @@ public void Spec01()
}
}

[Fact(DisplayName = "Should setup jslintnet script inside a javascript context")]
[Fact(DisplayName = "Should setup jslint inside a javascript context")]
public void Spec02()
{
using (var testable = new ConstructorTestable())
{
testable.Initialize();

I.Expect(testable.ContextRuns[0]).ToStartWith("// jslintnet.js");
I.Expect(testable.ContextRuns[0]).ToStartWith("// jslint.js");
}
}

[Fact(DisplayName = "Should setup jslint inside a javascript context")]
[Fact(DisplayName = "Should setup reporter inside a javascript context")]
public void Spec03()
{
using (var testable = new ConstructorTestable())
{
testable.Initialize();

I.Expect(testable.ContextRuns[1]).ToStartWith("// jslint.js");
I.Expect(testable.ContextRuns[1]).ToStartWith("// report.js");
}
}

[Fact(DisplayName = "Should setup jslintnet script inside a javascript context")]
public void Spec04()
{
using (var testable = new ConstructorTestable())
{
testable.Initialize();

I.Expect(testable.ContextRuns[2]).ToStartWith("// jslintnet.js");
}
}

Expand Down Expand Up @@ -136,8 +147,7 @@ public JSLintContextTestableBase()
this.ContextRuns = new List<string>();
this.JavaScriptContextMock = new Mock<IJavaScriptContext>();
this.Script = new ExpandoObject();
this.Script.JSLintNet = new ExpandoObject();
this.Script.JSLintNet.run = new Func<string, string, string>((x, y) => x + "_" + y);
this.Script.jslintnet = new Func<string, string, string, string>((x, y, z) => x + "_" + y);
}

public List<string> ContextRuns { get; private set; }
Expand Down
10 changes: 5 additions & 5 deletions specifications/JSLintNet.Specifications/JSLintTaskIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Spec01()
var actual = JSLintTaskHelper.ExecuteMSBuildProject("Errors");

I.Expect(actual.Success).ToBeFalse();
I.Expect(actual.ErrorCount).ToBe(12);
I.Expect(actual.ErrorCount).ToBe(11);
I.Expect(actual.ErrorFileCount).ToBe(3);
I.Expect(actual.ProcessedFileCount).ToBe(5);
}
Expand All @@ -28,7 +28,7 @@ public void Spec02()
var actual = JSLintTaskHelper.ExecuteMSBuildProject("SourceFiles");

I.Expect(actual.Success).ToBeFalse();
I.Expect(actual.ErrorCount).ToBe(12);
I.Expect(actual.ErrorCount).ToBe(11);
I.Expect(actual.ErrorFileCount).ToBe(3);
I.Expect(actual.ProcessedFileCount).ToBe(3);
}
Expand All @@ -39,7 +39,7 @@ public void Spec03()
var actual = JSLintTaskHelper.ExecuteMSBuildProject("Warnings");

I.Expect(actual.Success).ToBeTrue();
I.Expect(actual.ErrorCount).ToBe(12);
I.Expect(actual.ErrorCount).ToBe(11);
I.Expect(actual.ErrorFileCount).ToBe(3);
I.Expect(actual.ProcessedFileCount).ToBe(5);
}
Expand Down Expand Up @@ -70,7 +70,7 @@ public void Spec06()
var actual = JSLintTaskHelper.ExecuteMSBuildProject("OutputOverride");

I.Expect(actual.Success).ToBeFalse();
I.Expect(actual.ErrorCount).ToBe(12);
I.Expect(actual.ErrorCount).ToBe(11);
}

[Fact(DisplayName = "Should merge settings from configuration version")]
Expand All @@ -79,7 +79,7 @@ public void Spec07()
var actual = JSLintTaskHelper.ExecuteMSBuildProject("Configuration", "/p:Configuration=Release");

I.Expect(actual.Success).ToBeFalse();
I.Expect(actual.ErrorCount).ToBe(12);
I.Expect(actual.ErrorCount).ToBe(11);
}

[Fact(DisplayName = "Should load settings from linked JSLintNet.json file")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void Spec04()

var actual = this.Instance.SerializeSettings(settings);

I.Expect(actual).ToMatch(@"""options"": \{\s*""browser"": true,\s*""white"": true\s*\}, ""globalVariables"": \[""MyGlobal""\]");
I.Expect(actual).ToMatch(@"""options"": \{\s*""browser"": true,\s*""white"": true\s*\},\s*""globalVariables"": \[\s*""MyGlobal""\s*\]");
}
}

Expand Down

0 comments on commit 215451a

Please sign in to comment.