From 610c3184972da82e990350a8ae0ecfcc9e8f28b6 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Thu, 14 May 2015 01:51:44 +0900 Subject: [PATCH] Add tests for common seeds with separated targets. --- test/test_core.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/test/test_core.rb b/test/test_core.rb index 0b6ae50..485dff7 100644 --- a/test/test_core.rb +++ b/test/test_core.rb @@ -118,6 +118,48 @@ def test_install_separated_target refute self.phase(:TestProjTests).include_filename?(/JLToast.*\.(h|swift)/) end + def test_install_common_before_separated_target + seedfile %{ + github "devxoul/JLToast", "1.2.2", :files => "JLToast/*.{h,swift}" + + target :TestProjTests do + github "devxoul/SwipeBack", "1.0.4", :files => "SwipeBack/*.{h,m}" + end + } + @seed.install + + assert\ + self.phase(:TestProj).include_filename?(/JLToast.*\.(h|swift)/), + "TestProj should have JLToast files." + assert\ + self.phase(:TestProjTests).include_filename?(/.*SwipeBack\.(h|m)/), + "TestProjTests should have SwipeBack files." + assert\ + self.phase(:TestProjTests).include_filename?(/JLToast.*\.(h|swift)/), + "TestProjTests should have JLToast files." + end + + def test_install_common_after_separated_target + seedfile %{ + target :TestProjTests do + github "devxoul/SwipeBack", "1.0.4", :files => "SwipeBack/*.{h,m}" + end + + github "devxoul/JLToast", "1.2.2", :files => "JLToast/*.{h,swift}" + } + @seed.install + + assert\ + self.phase(:TestProj).include_filename?(/JLToast.*\.(h|swift)/), + "TestProj should have JLToast files." + assert\ + self.phase(:TestProjTests).include_filename?(/.*SwipeBack\.(h|m)/), + "TestProjTests should have SwipeBack files." + assert\ + self.phase(:TestProjTests).include_filename?(/JLToast.*\.(h|swift)/), + "TestProjTests should have JLToast files." + end + def test_remove seedfile %{ github "devxoul/JLToast", "1.2.2", :files => "JLToast/*.{h,swift}"