diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2020-02-13 23:06:33 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-02-13 23:06:33 +0900 |
commit | c6ebbbd38b997f8a8d6968e683e29db1e299b5aa (patch) | |
tree | 3cd61ac6bdaf485f2e5b040c28e221e1fca3c7d6 /spec | |
parent | ca53ab581b414ba86cfb5a6d51ca9a372c4ffcf8 (diff) | |
download | ruby-c6ebbbd38b997f8a8d6968e683e29db1e299b5aa.tar.gz |
spec/ruby: skip the specs that use /etc/passwd on Android
There is no /etc/passwd on Android
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/file/stat/owned_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/shared/file/executable.rb | 2 | ||||
-rw-r--r-- | spec/ruby/shared/file/readable.rb | 5 | ||||
-rw-r--r-- | spec/ruby/shared/file/writable.rb | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/spec/ruby/core/file/stat/owned_spec.rb b/spec/ruby/core/file/stat/owned_spec.rb index 6f0c250f88..fbd473c4d7 100644 --- a/spec/ruby/core/file/stat/owned_spec.rb +++ b/spec/ruby/core/file/stat/owned_spec.rb @@ -21,7 +21,7 @@ describe "File::Stat#owned?" do st.owned?.should == true end - platform_is_not :windows do + platform_is_not :windows, :android do as_user do it "returns false if the file is not owned by the user" do system_file = '/etc/passwd' diff --git a/spec/ruby/shared/file/executable.rb b/spec/ruby/shared/file/executable.rb index 2987d0aabb..7b5c4c580c 100644 --- a/spec/ruby/shared/file/executable.rb +++ b/spec/ruby/shared/file/executable.rb @@ -13,7 +13,7 @@ describe :file_executable, shared: true do rm_r @file1, @file2 end - platform_is_not :windows do + platform_is_not :windows, :android do it "returns true if named file is executable by the effective user id of the process, otherwise false" do @object.send(@method, '/etc/passwd').should == false @object.send(@method, @file1).should == true diff --git a/spec/ruby/shared/file/readable.rb b/spec/ruby/shared/file/readable.rb index 74f58caaff..eb2ca06812 100644 --- a/spec/ruby/shared/file/readable.rb +++ b/spec/ruby/shared/file/readable.rb @@ -4,9 +4,12 @@ describe :file_readable, shared: true do platform_is :windows do @file2 = File.join(ENV["WINDIR"], "system32/drivers/etc/services").tr(File::SEPARATOR, File::ALT_SEPARATOR) end - platform_is_not :windows do + platform_is_not :windows, :android do @file2 = "/etc/passwd" end + platform_is :android do + @file2 = "/system/bin/sh" + end end after :each do diff --git a/spec/ruby/shared/file/writable.rb b/spec/ruby/shared/file/writable.rb index 902d545da1..4bb8aedce6 100644 --- a/spec/ruby/shared/file/writable.rb +++ b/spec/ruby/shared/file/writable.rb @@ -8,7 +8,7 @@ describe :file_writable, shared: true do end it "returns true if named file is writable by the effective user id of the process, otherwise false" do - platform_is_not :windows do + platform_is_not :windows, :android do as_user do @object.send(@method, "/etc/passwd").should == false end |