-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
188 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: java | ||
jdk: | ||
- oraclejdk7 | ||
- oraclejdk8 | ||
before_install: | ||
- "export DISPLAY=:99.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/java/com/github/searls/jasmine/HtmlAssertions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.github.searls.jasmine; | ||
|
||
import org.assertj.core.api.AbstractCharSequenceAssert; | ||
|
||
public class HtmlAssertions extends AbstractCharSequenceAssert<HtmlAssertions, String> { | ||
|
||
public HtmlAssertions(String actual) { | ||
super(actual, HtmlAssertions.class); | ||
} | ||
|
||
public HtmlAssertions containsLinkTagWithSource(String src) { | ||
return this | ||
.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + src + "\"/>") | ||
.describedAs("contains <link/> tag with src='" + src + "'"); | ||
} | ||
|
||
public HtmlAssertions containsScriptTagWithSource(String src) { | ||
return this | ||
.contains("<script type=\"text/javascript\" src=\"" + src + "\"></script>") | ||
.describedAs("contains <script/> tag with src='" + src + "'"); | ||
} | ||
|
||
public static HtmlAssertions assertThat(String actual) { | ||
return new HtmlAssertions(actual); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 5 additions & 22 deletions
27
src/test/java/com/github/searls/jasmine/coffee/DetectsCoffeeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,30 @@ | ||
package com.github.searls.jasmine.coffee; | ||
|
||
import org.hamcrest.Description; | ||
import org.hamcrest.TypeSafeMatcher; | ||
import org.junit.Test; | ||
|
||
import static org.hamcrest.Matchers.is; | ||
import static org.hamcrest.Matchers.not; | ||
import static org.junit.Assert.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class DetectsCoffeeTest { | ||
|
||
private final DetectsCoffee subject = new DetectsCoffee(); | ||
|
||
@Test | ||
public void whenAStringEndingInCoffeeThatsCoffee() { | ||
assertThat("/some/path/to/pants.coffee", is(this.coffee())); | ||
assertThat(subject.detect("/some/path/to/pants.coffee")).isTrue(); | ||
} | ||
|
||
@Test | ||
public void whenAStringDoesNotEndInCoffeeThatsNotCoffee() { | ||
assertThat("/some/path/to/pants.cafe", is(not(this.coffee()))); | ||
assertThat(subject.detect("/some/path/to/pants.cafe")).isFalse(); | ||
} | ||
|
||
@Test | ||
public void whenCoffeeHasAQueryStringThatsCoffee() { | ||
assertThat("/some/path/to/pants.coffee?stillCoffee=true", is(this.coffee())); | ||
assertThat(subject.detect("/some/path/to/pants.coffee?stillCoffee=true")).isTrue(); | ||
} | ||
|
||
@Test | ||
public void whenJavaScriptHasACoffeeQueryThatsNotCoffee() { | ||
assertThat("/some/path/to/pants.js?extension=lulz.coffee", is(not(this.coffee()))); | ||
} | ||
|
||
private TypeSafeMatcher<String> coffee() { | ||
return new TypeSafeMatcher<String>() { | ||
@Override | ||
public boolean matchesSafely(String path) { | ||
return DetectsCoffeeTest.this.subject.detect(path); | ||
} | ||
|
||
@Override | ||
public void describeTo(Description desc) { | ||
} | ||
}; | ||
assertThat(subject.detect("/some/path/to/pants.cafe")).isFalse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.