spec/spotlight_query_spec.rb in spotlight-0.0.2 vs spec/spotlight_query_spec.rb in spotlight-0.0.3
- old
+ new
@@ -3,9 +3,15 @@
describe Spotlight::Query do
before do
@query = Spotlight::Query.new('kMDItemDisplayName = "spotlight_query_spec.rb"')
end
+ it "should create query from saved search" do
+ query = Spotlight::Query.from_saved_search(fixture('test.savedSearch'))
+ query.query_string.should eql('((true) && (true)) && ((* = "test*"cdw || kMDItemTextContent = "test*"cdw))')
+ query.scopes.should eql(['kMDQueryScopeComputer'])
+ end
+
it "should have query string" do
@query.query_string.should eql('kMDItemDisplayName = "spotlight_query_spec.rb"')
end
it "should execute query" do