spec/lib/bubble-wrap/requirement_spec.rb in bubble-wrap-1.0.0 vs spec/lib/bubble-wrap/requirement_spec.rb in bubble-wrap-1.1.0
- old
+ new
@@ -7,11 +7,11 @@
@subject = BubbleWrap::Requirement
end
describe '.scan' do
before do
- @subject.paths = {}
+ @subject.clear!
@root_path = File.expand_path('../../../../', __FILE__)
end
it 'asking for a not-yet-found file raises an exception' do
should.raise(Exception) do
@@ -19,11 +19,11 @@
end
end
it 'finds the specified file' do
@subject.scan(@root_path, 'motion/core.rb')
- @subject.paths.keys.first.should == 'motion/core.rb'
+ @subject.paths.keys.should.include 'motion/core.rb'
end
it 'finds multiple files according to spec' do
@subject.scan(@root_path, 'motion/**/*.rb')
@subject.files.size.should > 1
@@ -31,17 +31,17 @@
it 'never depends on itself' do
@subject.scan(@root_path, 'motion/core.rb') do
file('motion/core.rb').depends_on 'motion/core.rb'
end
- @subject.file('motion/core.rb').file_dependencies.should == []
+ @subject.file('motion/core.rb').file_dependencies.should.not.include 'motion/core.rb'
end
it 'can depend on another file' do
@subject.scan(@root_path, 'motion/*.rb') do
file('motion/http.rb').depends_on('motion/core.rb')
end
- @subject.file('motion/http.rb').file_dependencies.size.should == 1
+ @subject.file('motion/http.rb').file_dependencies.should.include @subject.file('motion/core.rb')
end
it 'can use a framework' do
@subject.scan(@root_path, 'motion/core.rb') do
file('motion/core.rb').uses_framework('FakeFramework')