Permalink
Browse files

Letting files be removed from the check queue

  • Loading branch information...
ymendel committed Jun 27, 2008
1 parent b1c5612 commit ec853b92259c2855e0a11c07a4887b10337ab4ea
Showing with 20 additions and 0 deletions.
  1. +3 −0 lib/conversion_observer.rb
  2. +17 −0 spec/conversion_observer_spec.rb
@@ -20,6 +20,9 @@ def add_file_to_check(file)
@files_to_check.uniq!
end
+ def remove_file_to_check(file)
+ @files_to_check.delete(file)
+ end
private
@@ -76,6 +76,10 @@
it 'should add a file to check' do
ConversionObserver.should respond_to(:add_file_to_check)
end
+
+ it 'should remove a file to check' do
+ ConversionObserver.should respond_to(:remove_file_to_check)
+ end
describe 'files to check' do
it 'should default to an empty array' do
@@ -108,5 +112,18 @@
ConversionObserver.files_to_check.should == [@file]
end
end
+
+ describe 'when removed' do
+ before :each do
+ ConversionObserver.send(:clear_files_to_check)
+ @file = stub('file')
+ ConversionObserver.add_file_to_check(@file)
+ end
+
+ it 'should remove the file from the array' do
+ ConversionObserver.remove_file_to_check(@file)
+ ConversionObserver.files_to_check.should == []
+ end
+ end
end
end

0 comments on commit ec853b9

Please sign in to comment.