require 'todos_export' describe TodosExport::Main do subject do TodosExport::Main.new('spec/resources') end it '#find_files' do subject.find_files subject.files.size.should == 3 end it '#find_exportables' do subject.find_exportables subject.exportables.size.should == 10 end it '#exportables' do subject.find_exportables subject.exportables.should == [ { :type => "FIXME", :content => "This is a useless class, what we really need to do is sit down and eat some cheese", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 2 }, { :type => "TODO", :content => "Find a kinder message", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 12 }, { :type => "TODO", :content => "Make a list", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 18 }, { :type => "FIXME", :content => "Use case statement", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 22 }, { :type => "TODO", :content => "Add more cheese types", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 26 }, { :type => "TODO", :content => "Add more region cheeses", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 35 }, { :type => "TODO", :content => "Personalize the class to your taste", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 41 }, { :type => "BUG", :content => "This should be false", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 46 }, { :type => "TODO", :content => "Be a better Ruby file", :file => 'spec/resources/sub_directory/another_ruby_file_with_todos.rb', :line => 1 }, { :type => "BUG", :content => "This should say it's a Ruby file", :file => 'spec/resources/sub_directory/another_ruby_file_with_todos.rb', :line => 2 } ] end it '#exportable_todos' do subject.find_exportables subject.exportable_todos.should == [ { :type => "TODO", :content => "Find a kinder message", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 12 }, { :type => "TODO", :content => "Make a list", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 18 }, { :type => "TODO", :content => "Add more cheese types", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 26 }, { :type => "TODO", :content => "Add more region cheeses", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 35 }, { :type => "TODO", :content => "Personalize the class to your taste", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 41 }, { :type => "TODO", :content => "Be a better Ruby file", :file => 'spec/resources/sub_directory/another_ruby_file_with_todos.rb', :line => 1 } ] end it '#exportable_fixmes' do subject.find_exportables subject.exportable_fixmes.should == [ { :type => "FIXME", :content => "This is a useless class, what we really need to do is sit down and eat some cheese", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 2 }, { :type => "FIXME", :content => "Use case statement", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 22 } ] end it '#exportable_bugs' do subject.find_exportables subject.exportable_bugs.should == [ { :type => "BUG", :content => "This should be false", :file => 'spec/resources/ruby_file_with_todos.rb', :line => 46 }, { :type => "BUG", :content => "This should say it's a Ruby file", :file => 'spec/resources/sub_directory/another_ruby_file_with_todos.rb', :line => 2 } ] end end