~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to bootstraptest/test_attr.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-05-16 12:37:06 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20080516123706-r4llcdfd35aobrjv
Tags: 1.9.0.1-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.
* debian/control:
  - ruby1.9 pkg: moved rdoc1.9 suggestion to depends. (LP: #228345)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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]'