File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
spec/ruby/core/proc/shared Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 32
32
describe "for a proc created with UnboundMethod#to_proc" do
33
33
it "returns a description including '(lambda)' and optionally including file and line number" do
34
34
def hello ; end
35
-
36
35
method ( "hello" ) . to_proc . send ( @method ) . should =~ /^#<Proc:([^ ]*?)(@([^ ]*)\/ to_s\. rb:22)? \( lambda\) >$/
37
36
end
38
37
39
38
it "has an ASCII-8BIT encoding" do
40
39
def hello ; end
41
-
42
40
method ( "hello" ) . to_proc . send ( @method ) . encoding . should == Encoding ::ASCII_8BIT
43
41
end
44
42
end
43
+
44
+ describe "for a proc created with Symbol#to_proc" do
45
+ it "returns a description including '(&:symbol)'" do
46
+ proc = :foobar . to_proc
47
+ proc . send ( @method ) . should =~ /^#<Proc:0x\h +\( &:foobar\) >$/
48
+ end
49
+
50
+ it "has an ASCII-8BIT encoding" do
51
+ proc = :foobar . to_proc
52
+ proc . send ( @method ) . encoding . should == Encoding ::ASCII_8BIT
53
+ end
54
+ end
45
55
end
You can’t perform that action at this time.
0 commit comments