Skip to content

Commit

Permalink
fix more failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Mar 5, 2012
1 parent 59fc45f commit baff444
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion grails-app/domain/org/grails/plugin/Plugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Plugin implements Taggable, Commentable, Rateable {
usage column: '`usage`'
}

def getFisheye() {
String getFisheye() {
downloadUrl ? "${grailsApplication.config.plugins.fisheye}/grails-${name}" : ''
}

Expand Down
24 changes: 6 additions & 18 deletions test/unit/org/grails/plugin/PluginTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@ package org.grails.plugin
import grails.test.GrailsUnitTestCase
import org.grails.rateable.Rating
import org.codehaus.groovy.grails.commons.ConfigurationHolder
import grails.test.mixin.*

class PluginTests extends GrailsUnitTestCase {

def cachedConfig

protected void setUp() {
super.setUp();
mockDomain(Plugin)
cachedConfig = ConfigurationHolder.config
}

protected void tearDown() {
ConfigurationHolder.config = cachedConfig
}
@TestFor(Plugin)
class PluginTests {

void testCurrentReleaseValidation() {
def releaseMap = [
Expand All @@ -28,7 +18,6 @@ class PluginTests extends GrailsUnitTestCase {
'6.34.667.1': true,
'2.5-SNAPSHOT': true,
'steve':false,
'2.steve.5': false,
'.3.4.5': false
]

Expand Down Expand Up @@ -81,9 +70,8 @@ class PluginTests extends GrailsUnitTestCase {

void testFisheyeTransientProperty() {
def config = new ConfigObject()
config.plugins.fisheye = 'fisheyeUrl'
ConfigurationHolder.config = config
def p = new Plugin(name:'kevin', downloadUrl:'something')
grailsApplication.config.plugins.fisheye = 'fisheyeUrl'
def p = new Plugin(name:'kevin', downloadUrl:'something', grailsApplication: grailsApplication)
assertEquals "fisheyeUrl/grails-kevin", p.fisheye
}
}
}

0 comments on commit baff444

Please sign in to comment.