Skip to content

Commit 8700d6a

Browse files
committed
Split WINDOWS/NON WINDOWS tests
1 parent a3e8704 commit 8700d6a

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

spec/u3d/installer_spec.rb

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,25 @@ class DummyInstaller < U3d::BaseInstaller
9090
end
9191

9292
describe ".extra_installation_paths" do
93-
it "converts paths to ruby paths" do
94-
installer = DummyInstaller.new
95-
env_var = if U3dCore::Helper.windows?
96-
"C:\\Program Files\\Unity;D:\\"
97-
else
98-
"/Applications/here:/Applications/else"
99-
end
100-
expected_paths = if U3dCore::Helper.windows?
101-
["C:/Program Files/Unity", "D:/"]
102-
else
103-
["/Applications/here", "/Applications/else"]
104-
end
105-
with_env_values('U3D_EXTRA_PATHS' => env_var) do
106-
expect(installer.send(:extra_installation_paths)).to eql(expected_paths)
93+
describe "converts paths to ruby paths" do
94+
def expect_extra_installation_paths(env_var, expected_paths)
95+
installer = DummyInstaller.new
96+
with_env_values('U3D_EXTRA_PATHS' => env_var) do
97+
expect(installer.send(:extra_installation_paths)).to eql(expected_paths)
98+
end
99+
end
100+
it "works on Windows", if: WINDOWS do
101+
expect_extra_installation_paths(
102+
"C:\\Program Files\\Unity;D:\\",
103+
["C:/Program Files/Unity", "D:/"]
104+
)
105+
end
106+
107+
it "works on Unix", unless: WINDOWS do
108+
expect_extra_installation_paths(
109+
"/Applications/here:/Applications/else",
110+
["/Applications/here", "/Applications/else"]
111+
)
107112
end
108113
end
109114
end

0 commit comments

Comments
 (0)