Skip to content

Commit

Permalink
Ensures that Proc can be cased due to backports.
Browse files Browse the repository at this point in the history
  • Loading branch information
blambeau committed Jun 13, 2012
1 parent b7d444d commit 8bab781
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -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
11 changes: 11 additions & 0 deletions spec/unit/test_assumptions.rb
Expand Up @@ -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
1 change: 1 addition & 0 deletions wlang.gemspec
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions wlang.noespec
Expand Up @@ -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.