Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement File and Dir for win32 #5623

Merged
merged 3 commits into from Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 12 additions & 15 deletions spec/std/dir_spec.cr
Expand Up @@ -230,15 +230,18 @@ describe "Dir" do
end

it "tests with relative path (starts with ..)" do
base_path = File.join("..", File.basename(Dir.current), "spec", "std", "data", "dir")
Dir["../#{File.basename(Dir.current)}/#{datapath}/dir/*/"].sort.should eq [
File.join(base_path, "dots", ""),
File.join(base_path, "subdir", ""),
File.join(base_path, "subdir2", ""),
].sort
Dir.cd(datapath) do
base_path = "../data/dir"
Dir["#{base_path}/*/"].sort.should eq [
File.join(base_path, "dots", ""),
File.join(base_path, "subdir", ""),
File.join(base_path, "subdir2", ""),
].sort
end
end

it "tests with relative path starting recursive" do
# TODO: This spec is broken on win32 because of `raise` weirdness on windows
pending_win32 "tests with relative path starting recursive" do
Dir["**/dir/*/"].sort.should eq [
datapath("dir", "dots", ""),
datapath("dir", "subdir", ""),
Expand Down Expand Up @@ -268,14 +271,8 @@ describe "Dir" do
Dir[""].should eq [] of String
end

it "root pattern" do
Dir["/"].should eq [
{% if flag?(:windows) %}
"C:\\"
{% else %}
"/"
{% end %},
]
pending_win32 "root pattern" do
Dir["/"].should eq ["/"]
end

it "pattern ending with .." do
Expand Down