repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
bootstraptest
/
test_attr.rb
blob
721a847145a797635699da9c7e10ec8262ac9731
1
assert_equal 'ok', %q{
2
module M
3
class A
4
class << self
5
attr_accessor :at
6
def workflow_rule
7
yield self
8
end
9
10
def eval_str(str)
11
eval(str)
12
end
13
end
14
end
15
end
16
begin
17
M::A.eval_str(<<-END)
18
workflow_rule do |r|
19
r.at 1
20
end
21
END
22
rescue ArgumentError => e
23
print "ok"
24
end
25
}, '[ruby-core:14641]'
26
27
assert_equal %{ok}, %{
28
class A
29
attr :m
30
end
31
begin
32
A.new.m(3)
33
rescue ArgumentError => e
34
print "ok"
35
end
36
}, '[ruby-core:15120]'