spec/codependency/node_spec.rb in codependency-0.2.0 vs spec/codependency/node_spec.rb in codependency-0.3.0
- old
+ new
@@ -3,16 +3,23 @@
describe Codependency::Node do
let( :parser ){ double 'Parser', :parse => [ 'body' ] }
context 'when the file exists', :files => :planets do
subject { Codependency::Node.new 'planet.rb', parser }
- its( :dependencies ){ should eq( [ 'body.rb' ] ) }
+ its( :edges ){ should eq( [ 'body.rb' ] ) }
end
context 'when the file does not exist' do
it 'should raise an error' do
expect {
Codependency::Node.new 'pluto.rb', parser
}.to raise_error( Errno::ENOENT, 'No such file or directory - pluto.rb' )
end
+ end
+
+ describe 'dependencies', :files => :planets do
+ let( :parser ){ double 'Parser', :parse => [ 'body', 'mars' ] }
+ subject { Codependency::Node.new 'phobos.rb', parser }
+
+ its( :dependencies ){ should eq( 'phobos.rb body.rb phobos.rb mars.rb' ) }
end
end