spec/codependency/graph_spec.rb in codependency-2.3.0 vs spec/codependency/graph_spec.rb in codependency-2.3.1
- old
+ new
@@ -7,10 +7,12 @@
its( :path ){ should be_a( Codependency::Path ) }
its( :path ){ should be_empty }
end
describe '#require', :fixtures => true do
+ before { subject.require file }
+
describe 'solar_system' do
example( 'body.rb' ){ verify { subject } }
example( 'earth.rb' ){ verify { subject } }
example( 'mars.rb' ){ verify { subject } }
example( 'phobos.rb' ){ verify { subject } }
@@ -34,10 +36,12 @@
example( 'application.js' ){ verify { subject } }
end
end
describe '#tsort', :fixtures => true do
+ before { subject.require file }
+
describe 'solar_system' do
example( 'body.rb' ){ verify { subject.tsort } }
example( 'earth.rb' ){ verify { subject.tsort } }
example( 'mars.rb' ){ verify { subject.tsort } }
example( 'phobos.rb' ){ verify { subject.tsort } }
@@ -61,10 +65,12 @@
example( 'application.js' ){ verify { subject.tsort } }
end
end
describe '#files', :fixtures => true do
+ before { subject.require file }
+
describe 'solar_system' do
example( 'body.rb' ){ verify { subject.files } }
example( 'earth.rb' ){ verify { subject.files } }
example( 'mars.rb' ){ verify { subject.files } }
example( 'phobos.rb' ){ verify { subject.files } }
@@ -75,17 +81,32 @@
example( 'egg.js' ){ verify { subject.files } }
example( 'sandwich.js' ){ verify { subject.files } }
example( 'toast.js' ){ verify { subject.files } }
end
describe 'lox' do
- example( 'money.rb' ){ expect { subject.tsort }.to raise_error( TSort::Cyclic ) }
- example( 'power.rb' ){ expect { subject.tsort }.to raise_error( TSort::Cyclic ) }
- example( 'respect.rb' ){ expect { subject.tsort }.to raise_error( TSort::Cyclic ) }
+ example( 'money.rb' ){ expect { subject.files }.to raise_error( TSort::Cyclic ) }
+ example( 'power.rb' ){ expect { subject.files }.to raise_error( TSort::Cyclic ) }
+ example( 'respect.rb' ){ expect { subject.files }.to raise_error( TSort::Cyclic ) }
end
describe 'assets' do
example( 'templates/account.js' ){ verify { subject.files } }
example( 'templates/history.js' ){ verify { subject.files } }
example( 'templates/user.js' ){ verify { subject.files } }
example( 'application.js' ){ verify { subject.files } }
+ end
+ end
+
+ describe '#scan', :fixtures => true do
+ before { subject.scan file }
+
+ describe 'solar_system' do
+ example( '*.rb' ){ verify { subject.files } }
+ end
+ describe 'breakfast' do
+ example( '*.js' ){ verify { subject.files } }
+ end
+ describe 'assets' do
+ example( '*.js' ){ verify { subject.files } }
+ example( 'templates/*.js' ){ verify { subject.files } }
end
end
end