Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Aug 5, 2023
1 parent 5d1b653 commit b54ac57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class PluginsFacade implements PluginStateListener {
}

// add cloudcache plugin when NXF_CLOUDCACHE_PATH is set
if( env.containsKey('NXF_CLOUDCACHE_PATH') ) {
if( env.NXF_CLOUDCACHE_PATH ) {
specs << defaultPlugins.getPlugin('nf-cloudcache')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class PluginsFacadeTest extends Specification {
given:
def defaults = new DefaultPlugins(plugins: [
'nf-amazon': new PluginSpec('nf-amazon', '0.1.0'),
'nf-cloudcache': new PluginSpec('nf-cloudcache', '0.1.0'),
'nf-google': new PluginSpec('nf-google', '0.1.0'),
'nf-tower': new PluginSpec('nf-tower', '0.1.0'),
'nf-wave': new PluginSpec('nf-wave', '0.1.0')
Expand Down Expand Up @@ -138,6 +139,12 @@ class PluginsFacadeTest extends Specification {
then:
result == [ new PluginSpec('nf-google','2.0.0') ]

when:
handler = new PluginsFacade(defaultPlugins: defaults, env: [NXF_CLOUDCACHE_PATH:'xyz'])
result = handler.pluginsRequirement([:])
then:
result == [ new PluginSpec('nf-cloudcache', '0.1.0') ]

}

def 'should return default plugins given config' () {
Expand Down

0 comments on commit b54ac57

Please sign in to comment.