spec/oneshot_spec.rb in observed-0.1.1 vs spec/oneshot_spec.rb in observed-0.2.0.rc1
- old
+ new
@@ -50,9 +50,14 @@
it 'initializes' do
expect(subject.run.size).not_to eq(0)
end
end
end
- context 'with configuration directories' do
-
+ describe '#parse_argv!' do
+ it 'parses ARGV like arrays and extracts Hash objects containing initialization parameters' do
+ argv = %w| -l logfile -d observed.rb foo1 |
+ params = Observed::Application::Oneshot.parse_argv! argv
+ expect(params).to eq({log_file: Pathname.new('logfile'), debug: true, config_file: 'observed.rb'})
+ expect(argv).to eq(%w| foo1 |)
+ end
end
end