Skip to content

Commit

Permalink
Revert "Set timeout parameter for terminal-notifier"
Browse files Browse the repository at this point in the history
This reverts commit c5fcb9c.

This option has been removed since terminal-notifier v2.0.0
  • Loading branch information
jcgay committed Nov 1, 2017
1 parent 9d0fb02 commit 0a26ad5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ public void send(Notification notification) {
}
commands.add("-appIcon");
commands.add(application.icon().asPath());
if (application.timeout() != -1) {
commands.add("-timeout");
commands.add(String.valueOf(Math.round(application.timeout() / 1000)));
}

try {
executor.exec(commands.toArray(new String[commands.size()]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class TerminalNotifierSpec extends Specification {

def setup() {
def configuration = TerminalNotifierConfiguration.create([
'notifier.notification-center.path' : TerminalNotifierConfiguration.byDefault().bin(),
'notifier.notification-center.activate': 'com.apple.Terminal',
'notifier.notification-center.sound' : 'default'
'notifier.notification-center.path':TerminalNotifierConfiguration.byDefault().bin(),
'notifier.notification-center.activate':'com.apple.Terminal',
'notifier.notification-center.sound':'default'
] as Properties)
notifier = new TerminalNotifier(application, configuration, executor)
}
Expand Down Expand Up @@ -114,18 +114,4 @@ class TerminalNotifierSpec extends Specification {
!result
1 * executor.tryExec([TerminalNotifierConfiguration.byDefault().bin(), '-help']) >> false
}

def "should set timeout when application includes one"() {
given:
def application = Application.builder('id', 'name', TestIcon.application()).timeout(1000).build()
def notifier = new TerminalNotifier(application, TerminalNotifierConfiguration.byDefault(), executor)
def notification = Notification.builder('title', 'message', TestIcon.ok()).build()

when:
notifier.send(notification)

then:
executor.executedCommand.join(' ').contains('-timeout 1')
!executor.executedCommand.join(' ').contains('-timeout 1000')
}
}

0 comments on commit 0a26ad5

Please sign in to comment.