I believe you should be able to test that defining the constant in the test and in the file (untested):
c.rb
class C; end
my_test.rb
class C; end
… store in cache …
Object.instance_eval { remove_const(:C) }
… load from cache …
Something like that.