-
Notifications
You must be signed in to change notification settings - Fork 119
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
9 changed files
with
147 additions
and
67 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package pl.touk.sputnik; | ||
|
||
import org.assertj.core.api.Assertions; | ||
import pl.touk.sputnik.assertion.ViolationAssert; | ||
import pl.touk.sputnik.review.Violation; | ||
|
||
public class SputnikAssertions extends Assertions { | ||
|
||
public static ViolationAssert assertThat(Violation actual) { | ||
return new ViolationAssert(actual); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/test/java/pl/touk/sputnik/assertion/ViolationAssert.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,32 @@ | ||
package pl.touk.sputnik.assertion; | ||
|
||
import org.assertj.core.api.AbstractAssert; | ||
import pl.touk.sputnik.review.Severity; | ||
import pl.touk.sputnik.review.Violation; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class ViolationAssert extends AbstractAssert<ViolationAssert, Violation> { | ||
|
||
public ViolationAssert(Violation actual) { | ||
super(actual, ViolationAssert.class); | ||
} | ||
|
||
public ViolationAssert hasLine(int line) { | ||
isNotNull(); | ||
assertThat(actual.getLine()).isEqualTo(line); | ||
return this; | ||
} | ||
|
||
public ViolationAssert hasMessage(String message) { | ||
isNotNull(); | ||
assertThat(actual.getMessage()).isEqualTo(message); | ||
return this; | ||
} | ||
|
||
public ViolationAssert hasSeverity(Severity severity) { | ||
isNotNull(); | ||
assertThat(actual.getSeverity()).isEqualTo(severity); | ||
return this; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//Part of an original file copied from a Redux documentation: | ||
//https://redux.js.org/docs/basics/Reducers.html | ||
|
||
import { combineReducers } from 'redux' | ||
import { | ||
ADD_TODO, | ||
TOGGLE_TODO, | ||
SET_VISIBILITY_FILTER, | ||
VisibilityFilters | ||
} from './actions' | ||
const { SHOW_ALL } = VisibilityFilters | ||
|
||
function visibilityFilter(state = SHOW_ALL, action) { | ||
switch (action.type) { | ||
case SET_VISIBILITY_FILTER: | ||
return action.filter | ||
default: | ||
return state | ||
} | ||
} | ||
|
||
export default visibilityFilter; |
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,3 +1,3 @@ | ||
function test() { | ||
alert('foo bar'); | ||
} | ||
alert('foo bar') | ||
} |
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,3 +1,6 @@ | ||
{ | ||
"undef": true | ||
"undef": true, | ||
"unused": true, | ||
"devel": true, | ||
"esversion": 6 | ||
} |