spec/adapter_spec.rb in looksee-1.0.3 vs spec/adapter_spec.rb in looksee-1.1.0

- old
+ new

@@ -193,10 +193,15 @@ temporary_class :C C.send(:define_method, :f){} C.send(:remove_method, :f) @adapter.internal_undefined_instance_methods(C).should == [] end + + it "should handle the MRI allocator being undefined (e.g. Struct)" do + struct_singleton_class = (class << Struct; self; end) + @adapter.internal_undefined_instance_methods(struct_singleton_class).should == [] + end end end describe "#singleton_class?" do it "should return true if the object is a singleton class of an object" do @@ -429,10 +434,11 @@ end describe "#source_location" do def load_source(source) @tmp = "#{ROOT}/spec/tmp" - @source_path = "#@tmp/c.rb" + # rbx 1.2.3 caches the file content by file name - ensure file names are different. + @source_path = "#@tmp/c#{__id__}.rb" FileUtils.mkdir_p @tmp open(@source_path, 'w') { |f| f.print source } load @source_path @source_path end