spec/option_parser_spec.rb in launch-agent-0.7.0 vs spec/option_parser_spec.rb in launch-agent-0.8.0

- old
+ new

@@ -106,9 +106,43 @@ plist['EnvironmentVariables'].should eql({ 'FOO' => 'BAR', 'BAR' => 'BAZ' }) end end + describe '--stdout' do + let(:opts) do + @opts.merge( + '--daemon' => true, + '--stdout' => '~/foo/bar.log') + end + + it_should_behave_like 'valid agent' + + it 'should parse env option' do + agent = CLI::OptionParser.new(opts, @argv).agent + plist = agent2plist(agent) + + plist['StandardOutPath'].should eql(File.expand_path('~/foo/bar.log')) + end + end + + describe '--stderr' do + let(:opts) do + @opts.merge( + '--daemon' => true, + '--stderr' => '~/foo/bar.log') + end + + it_should_behave_like 'valid agent' + + it 'should parse env option' do + agent = CLI::OptionParser.new(opts, @argv).agent + plist = agent2plist(agent) + + plist['StandardErrorPath'].should eql(File.expand_path('~/foo/bar.log')) + end + end + describe 'interval' do let(:opts) do @opts.merge( '--interval' => "120") end