spec/basic_spec.rb in divining_rod-0.1.1 vs spec/basic_spec.rb in divining_rod-0.2.0
- old
+ new
@@ -30,9 +30,25 @@
@request = mock("rails_request", :user_agent => 'My Foo Phone')
profile = DiviningRod::Profile.new(@request)
profile.wap?.should be_false
end
+ describe "without a default definition" do
+
+ before :each do
+ @request = mock("rails_request", :user_agent => 'Foo Fone')
+ DiviningRod::Matchers.clear_definitions
+ DiviningRod::Matchers.define do |map|
+ map.ua /iPhone/, :webkit, :tags => [:iphone, :youtube, :geolocate]
+ end
+ end
+
+ it "should not find a match" do
+ DiviningRod::Profile.new(@request).recognized?.should be_false
+ end
+
+ end
+
end
describe DiviningRod::Matchers do
\ No newline at end of file