diff --git a/Ruby/spec/terminal-notifier_spec.rb b/Ruby/spec/terminal-notifier_spec.rb index eaa59b7..226249c 100644 --- a/Ruby/spec/terminal-notifier_spec.rb +++ b/Ruby/spec/terminal-notifier_spec.rb @@ -15,6 +15,13 @@ IO.expects(:popen).with(command).yields(StringIO.new('output')) TerminalNotifier.execute(false, :message => '[ZOMG] "OH YEAH"') end + + it "correctly escapes arguments that start with a dash" do + command = [TerminalNotifier::BIN_PATH, '-message', ' -kittens', '-title', ' -rule'] + command = Shellwords.join(command) if RUBY_VERSION < '1.9' + IO.expects(:popen).with(command).yields(StringIO.new('output')) + TerminalNotifier.execute(false, :message => '-kittens', :title => '-rule') + end it "returns the result output of the command" do TerminalNotifier.execute(false, 'help' => '').should == `'#{TerminalNotifier::BIN_PATH}' -help`