spec/jsus/source_file_spec.rb in jsus-0.2.1 vs spec/jsus/source_file_spec.rb in jsus-0.2.2

- old
+ new

@@ -257,6 +257,20 @@ subject.content.index(extension.content).should_not be_nil subject.content.index(initial_content).should < subject.content.index(extension.content) end end end + + describe "#==, eql, hash" do + it "should return true for source files pointing to the same physical file" do + subject.should == described_class.from_file(subject.filename) + subject.should eql(described_class.from_file(subject.filename)) + subject.hash.should == described_class.from_file(subject.filename).hash + end + + it "should return false for source files pointing to different physical files" do + subject.should_not == described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js") + subject.should_not eql(described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js")) + subject.hash.should_not == described_class.from_file("spec/data/Extensions/app/javascripts/Orwik/Extensions/Class.js").hash + end + end end \ No newline at end of file