Skip to content

Commit 33b3810

Browse files
committed
#542 detect windows in specs, skip symbolic link tests since windows link permissions require admin
1 parent 04d7560 commit 33b3810

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

spec/actions/create_link_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require "thor/actions"
33
require "tempfile"
44

5-
describe Thor::Actions::CreateLink do
5+
describe Thor::Actions::CreateLink, :unless => windows? do
66
before do
77
@silence = false
88
@hardlink_to = File.join(Dir.tmpdir, "linkdest.rb")

spec/actions/file_manipulation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def file
9696
end
9797
end
9898

99-
describe "#link_file" do
99+
describe "#link_file", :unless => windows? do
100100
it "links file from source to default destination" do
101101
action :link_file, "command.thor"
102102
exists_and_identical?("command.thor", "command.thor")

spec/helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,12 @@ def silence_warnings
7979
$VERBOSE = old_verbose
8080
end
8181

82+
# true if running on windows, used for conditional spec skips
83+
#
84+
# @return [TrueClass/FalseClass]
85+
def windows?
86+
Gem.win_platform?
87+
end
88+
8289
alias silence capture
8390
end

0 commit comments

Comments
 (0)