Permalink
Browse files

Ensures that Proc can be cased due to backports.

  • Loading branch information...
blambeau committed Jun 13, 2012
1 parent b7d444d commit 8bab7816b39fc4ccde0f0da0f4c8d449afa0f14f
Showing with 14 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +11 −0 spec/unit/test_assumptions.rb
  3. +1 −0 wlang.gemspec
  4. +1 −0 wlang.noespec
View
@@ -16,4 +16,5 @@ group :development do
gem "rspec", "~> 2.10.0"
gem "yard", "~> 0.8.1"
gem "bluecloth", "~> 2.2.0"
+ gem "sinatra", :git => "git://github.com/sinatra/sinatra" #">= 1.4"
end
@@ -26,4 +26,15 @@ def arity2(fn1,fn2); end
lambda{|fn1,fn2|}.arity.should eq(2)
end
+ it 'allows using a Proc usable in a case statement' do
+ proc = lambda{|x| x > 10}
+ [ 17, 3 ].map{|x|
+ case x
+ when proc then x*10
+ else
+ x
+ end
+ }.should eq([170, 3])
+ end
+
end
View
@@ -129,6 +129,7 @@ Gem::Specification.new do |s|
s.add_development_dependency("rspec", "~> 2.10.0")
s.add_development_dependency("yard", "~> 0.8.1")
s.add_development_dependency("bluecloth", "~> 2.2.0")
+ s.add_development_dependency("sinatra", ">= 1.4")
s.add_dependency("citrus", "~> 2.4.1")
s.add_dependency("temple", "~> 0.4.0")
s.add_dependency("quickl", "~> 0.4.3")
View
@@ -43,3 +43,4 @@ variables:
- {name: rspec, version: "~> 2.10.0", groups: [development]}
- {name: yard, version: "~> 0.8.1", groups: [development]}
- {name: bluecloth, version: "~> 2.2.0", groups: [development]}
+ - {name: sinatra, version: ">= 1.4", groups: [development]}

0 comments on commit 8bab781

Please sign in to comment.