spec/rake/funnel/support/finder_spec.rb in rake-funnel-0.0.3.pre vs spec/rake/funnel/support/finder_spec.rb in rake-funnel-0.0.4.pre
- old
+ new
@@ -1,5 +1,7 @@
+require 'tmpdir'
+
include Rake::Funnel
describe Rake::Funnel::Support::Finder do
let(:pattern) { %W(#{temp_dir}/**/*.sln #{temp_dir}/**/*.??proj) }
let(:generate) { [] }
@@ -83,9 +85,25 @@
let(:pattern) { %w(**/* **/*) }
it 'should remove duplicates' do
Dir.chdir(temp_dir) do
expect(subject.all_or_default).to match_array(generate)
+ end
+ end
+ end
+ end
+
+ describe 'source is evaluated lazily' do
+ let(:pattern) { FileList['*.example'] }
+
+ it 'should detect new files' do
+ expect(subject.all_or_default).to be_empty
+
+ Dir.mktmpdir do |tmp|
+ Dir.chdir(tmp) do
+ FileUtils.touch('new file.example')
+
+ expect(subject.all).to include('new file.example')
end
end
end
end