Skip to content

Commit

Permalink
updating to remove jquery in favor of smaller analysis samples
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyrob99 committed Dec 27, 2010
1 parent 956665f commit 4e490ac
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 14,364 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Expand Up @@ -2,17 +2,20 @@ apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven'

group = 'org.kar'
version = '0.1-SNAPSHOT'

repositories {
mavenCentral()
}

def FIRST_LEVEL_JMOCK = ['org.hamcrest:hamcrest-core:1.2@jar', 'org.hamcrest:hamcrest-library:1.2@jar', 'org.jmock:jmock-junit4:2.5.1@jar']
def HAMCREST = ['org.hamcrest:hamcrest-core:1.2@jar', 'org.hamcrest:hamcrest-library:1.2@jar']

dependencies {
compile gradleApi()
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.5'
groovy group: 'org.codehaus.groovy', name: 'groovy', version: '1.7.6'
testCompile group: 'junit', name: 'junit', version: '4.8.2'
testCompile FIRST_LEVEL_JMOCK
testCompile HAMCREST
}

ideaModule {
Expand Down
Expand Up @@ -16,6 +16,8 @@ import static org.junit.Assert.*
class JSLintPluginTest
{
private static final String TEST_SOURCE_PATH = new File('.', 'src/test/resources').absolutePath
private static final String ERROR_JS = 'errorjs.js'
private static final String PASSING_JS = 'simplejs.js'

@Rule
public TemporaryFolder tmpDir = new TemporaryFolder();
Expand Down Expand Up @@ -67,7 +69,7 @@ class JSLintPluginTest
}

@Test(expected = TaskExecutionException.class)
public void antTaskShouldFailOnJQuery()
public void antTaskShouldFailOnJOnTestJS()
{
plugin.apply(project)
JSLintPluginConvention convention = plugin.jsLintpluginConvention
Expand All @@ -78,7 +80,37 @@ class JSLintPluginTest
}

@Test
public void settingHaltOnFailureFalseShouldWorkOnJQuery()
public void inclusionShouldWorkToSpecifyFiles()
{
plugin.apply(project)
JSLintPluginConvention convention = plugin.jsLintpluginConvention
convention.with {
inputDirs = [TEST_SOURCE_PATH]
includes = PASSING_JS
}
project.getTasksByName(JSLintPlugin.TASK_NAME, false).iterator().next().execute()
File file = new File(convention.createOutputFileName())
assertThat(file.exists(), equalTo(true))
assertThat(file.size(), equalTo(0l))
}

@Test
public void exclusionShouldWorkToSpecifyFiles()
{
plugin.apply(project)
JSLintPluginConvention convention = plugin.jsLintpluginConvention
convention.with {
inputDirs = [TEST_SOURCE_PATH]
excludes = ERROR_JS
}
project.getTasksByName(JSLintPlugin.TASK_NAME, false).iterator().next().execute()
File file = new File(convention.createOutputFileName())
assertThat(file.exists(), equalTo(true))
assertThat(file.size(), equalTo(0l))
}

@Test
public void settingHaltOnFailureFalseShouldWork()
{
plugin.apply(project)
JSLintPluginConvention convention = plugin.jsLintpluginConvention
Expand All @@ -92,7 +124,6 @@ class JSLintPluginTest
assertThat(file.size(), greaterThan(0l))
}


@Test
public void htmlFormatterTypeShouldTriggerXsltTransform()
{
Expand Down
4 changes: 4 additions & 0 deletions src/test/resources/errorjs.js
@@ -0,0 +1,4 @@
if(true == 'true')
{
document.write("Hello World!");
}

0 comments on commit 4e490ac

Please sign in to comment.