test/test_est.rb in est-0.2.1 vs test/test_est.rb in est-0.3
- old
+ new
@@ -73,9 +73,39 @@
]
)
end
end
+ def test_empty_dir
+ Dir.mktmpdir 'test' do |dir|
+ opts = opts(['-v', '-d', dir])
+ matches(
+ Nokogiri::XML(Est::Base.new(opts).xml),
+ [
+ '/estimate/@version',
+ '/estimate/@date',
+ '/estimate[total="0"]',
+ '/estimate[not(ests)]'
+ ]
+ )
+ end
+ end
+
+ def test_empty_dir
+ Dir.mktmpdir 'test' do |dir|
+ opts = opts(['-v', '-d', File.join(dir, 'absent')])
+ matches(
+ Nokogiri::XML(Est::Base.new(opts).xml),
+ [
+ '/estimate/@version',
+ '/estimate/@date',
+ '/estimate[total="0"]',
+ '/estimate[not(ests)]'
+ ]
+ )
+ end
+ end
+
def opts(args)
Slop.parse args do
on 'v', 'verbose'
on 'd', 'dir', argument: :required
end