Sha256: a65b6cb0219e03e029e0b0c4c79310b78ce3a5cf8f8f934bb4ea9fa4ea784429

Contents?: true

Size: 1.01 KB

Versions: 91

Compression:

Stored size: 1.01 KB

Contents

class Lousy_inspect
  attr_accessor :var
  def inspect    # An unhelpful inspect
    throw "Foo"  # Raises an exception
  end
  def initialize
    @var = 'initialized'
  end
end
class Lousy_inspect_and_to_s
  attr_accessor :var
  def inspect    # An unhelpful inspect
    throw "Foo"  # Raises an exception
  end
  def to_s       # An unhelpful to_s
    throw "bar"  # Raises an exception
  end
  def initialize
    @var = 'initialized'  # Something to inspect
  end
end

# Something that will be passed objects with
# bad inspect or to_s methods
class UnsuspectingClass
  @@Const = 'A constant'
  @@var = 'a class variable'
  def initialize(a)
    @a = a      # "info locals" will try to use
                # inspect or to_s here
    @b = 5
  end
end
def test_Lousy_inspect
  x = Lousy_inspect.new
  return x
end
def test_lousy_inspect_and_to_s
  x = Lousy_inspect_and_to_s.new
  return x
end
x = test_Lousy_inspect
y = test_lousy_inspect_and_to_s
UnsuspectingClass.new(10)
UnsuspectingClass.new(x)
UnsuspectingClass.new(y)
y = 2

Version data entries

91 entries across 78 versions & 8 rubygems

Version Path
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-0.2.8/test/example/info-var-bug.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/test/example/info-var-bug.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/test/example/info-var-bug.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/test/example/info-var-bug.rb
avalara_sdk-24.12.0 vendor/bundle/ruby/2.7.0/gems/debase-0.2.8/test/example/info-var-bug.rb
debase-0.2.8 test/example/info-var-bug.rb
debase-0.2.7 test/example/info-var-bug.rb
debase-0.2.6 test/example/info-var-bug.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/debase-0.2.5.beta2/test/example/info-var-bug.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/debase-0.2.5.beta1/test/example/info-var-bug.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/test/example/info-var-bug.rb