move Environment.parse_makefile_deps to Util

This commit is contained in:
josh committed 2019-02-10 21:23:52 -05:00
1 parent db788cdd35
commit 1b63dc7503
7 files changed
+49 -47

No files matched your search

-19
View File
@@ -255,24 +255,5 @@ module Rscons
expect(subject.__send__(:features_met?, builder, %w[-shared])).to be_falsey
end
end
describe ".parse_makefile_deps" do
it 'handles dependencies on one line' do
expect(File).to receive(:read).with('makefile').and_return(<<EOS)
module.o: source.cc
EOS
expect(Environment.parse_makefile_deps('makefile')).to eq ['source.cc']
end
it 'handles dependencies split across many lines' do
expect(File).to receive(:read).with('makefile').and_return(<<EOS)
module.o: module.c \\
module.h \\
other.h
EOS
expect(Environment.parse_makefile_deps('makefile')).to eq [
'module.c', 'module.h', 'other.h']
end
end
end
end
+19
View File
@@ -111,5 +111,24 @@ module Rscons
end
end
describe ".parse_makefile_deps" do
it 'handles dependencies on one line' do
expect(File).to receive(:read).with('makefile').and_return(<<EOS)
module.o: source.cc
EOS
expect(Util.parse_makefile_deps('makefile')).to eq ['source.cc']
end
it 'handles dependencies split across many lines' do
expect(File).to receive(:read).with('makefile').and_return(<<EOS)
module.o: module.c \\
module.h \\
other.h
EOS
expect(Util.parse_makefile_deps('makefile')).to eq [
'module.c', 'module.h', 'other.h']
end
end
end
end