Sha256: 111f663ea13c01c9627ae2fb44c21d2a5ed78ba49b21f092be0891bd3eecbd56
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
require 'helper' class TestMemoryLeak < Test::Unit::TestCase def setup super FakeWeb.clean_registry FakeWeb.allow_net_connect = false FakeWeb.register_uri :get, 'http://carbon.brighterplanet.com/emitters.json', :status => ["500", "Urg"], :body => nil end def test_attack_array # it's possible to attack the local copy... local_copy = ::BrighterPlanet.metadata.emitters assert local_copy.include?('AutomobileTrip') local_copy.clear assert local_copy.empty? # but not me! assert ::BrighterPlanet.metadata.emitters.include?('AutomobileTrip') ::BrighterPlanet.metadata.emitters.clear assert ::BrighterPlanet.metadata.emitters.include?('AutomobileTrip') end def test_attack_strings # it's possible to attack the local copy, obviously... local_copy = ::BrighterPlanet.metadata.emitters assert local_copy.include?('AutomobileTrip') local_copy.map { |name| name.upcase! } assert local_copy.include?('AUTOMOBILETRIP') # but not me! ::BrighterPlanet.metadata.emitters.map { |name| name.upcase! } assert ::BrighterPlanet.metadata.emitters.include?('AutomobileTrip') end end
Version data entries
16 entries across 16 versions & 1 rubygems