Take the 2008 Git User's Survey and help out! [ hide ]

public
Rubygem
Description: Resource-oriented open source Ruby framework for Web apps.
Homepage: http://rubywaves.com/
Clone URL: git://github.com/dyoder/waves.git
Search Repo:
added regexp example to specs for constraints
automatthew (author)
Tue Jul 22 08:33:29 -0700 2008
commit  5425d37a3b2c5482a761a9bcb8e9eaa316b4037f
tree    eb40542133c9deb8f7a50f0aba861980e06bea19
parent  df5834a132827e2c3176686d47c2ab2f88c394e3
...
29
30
31
 
 
 
 
 
 
 
32
33
34
...
29
30
31
32
33
34
35
36
37
38
39
40
41
0
@@ -29,6 +29,13 @@ describe "A mapping" do
0
     request.get("/foo", 'HTTP_ACCEPT' => 'text/xml').status.should == 404
0
   end
0
   
0
+ it "can use a Regexp on any of the above" do
0
+ mapping.action( :accept => /image|audio/ ) { "boooring."}
0
+
0
+ request.get("/foo", 'HTTP_ACCEPT' => 'image/jpeg').status.should == 200
0
+ request.get("/foo", 'HTTP_ACCEPT' => 'text/xml').status.should == 404
0
+ end
0
+
0
   it "can use a lambda on any of the above" do
0
     mapping.action( :accept => lambda { |types| types.include? 'text/plain' } ) { "boooring."}
0
     mapping.action( :accept => lambda { |types| types.include? /image/ } ) { "cool."}

Comments

    No one has commented yet.