-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7854 from rolandwalker/accessibility_stanza
DSL: add `accessibility_access` stanza
- Loading branch information
Showing
14 changed files
with
174 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
require 'test_helper' | ||
|
||
# todo: this test should be named after the corresponding class, once | ||
# that class is abstracted from installer.rb. | ||
describe "Accessibility Access" do | ||
before do | ||
cask = Cask.load('with-accessibility-access') | ||
@installer = Cask::Installer.new(cask, Cask::FakeSystemCommand) | ||
end | ||
|
||
describe "install" do | ||
it "can enable accessibility access" do | ||
MacOS.stubs(:version => OS::Mac::Version.new('10.9')) | ||
|
||
@installer.stubs(:bundle_identifier => 'com.example.BasicCask') | ||
|
||
Cask::FakeSystemCommand.expects_command( | ||
['/usr/bin/sudo', '-E', '--', '/usr/bin/sqlite3', Cask.tcc_db, %q{INSERT INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);}] | ||
) | ||
shutup do | ||
@installer.enable_accessibility_access | ||
end | ||
end | ||
|
||
it "can enable accessibility access in OS X versions prior to Mavericks" do | ||
MacOS.stubs(:version => OS::Mac::Version.new('10.8')) | ||
|
||
Cask::FakeSystemCommand.expects_command( | ||
['/usr/bin/sudo', '-E', '--', '/usr/bin/touch', Cask.pre_mavericks_accessibility_dotfile] | ||
) | ||
shutup do | ||
@installer.enable_accessibility_access | ||
end | ||
end | ||
end | ||
|
||
describe "uninstall" do | ||
it "can disable accessibility access" do | ||
MacOS.stubs(:version => OS::Mac::Version.new('10.9')) | ||
|
||
@installer.stubs(:bundle_identifier => 'com.example.BasicCask') | ||
|
||
Cask::FakeSystemCommand.expects_command( | ||
['/usr/bin/sudo', '-E', '--', '/usr/bin/sqlite3', Cask.tcc_db, %q{DELETE FROM access WHERE client='com.example.BasicCask';}] | ||
) | ||
shutup do | ||
@installer.disable_accessibility_access | ||
end | ||
end | ||
it "warns about disabling accessibility access on old OS X versions" do | ||
MacOS.stubs(:version => OS::Mac::Version.new('10.8')) | ||
|
||
@installer.stubs(:bundle_identifier => 'com.example.BasicCask') | ||
|
||
out, err = capture_io do | ||
@installer.disable_accessibility_access | ||
end | ||
err.must_match('Warning: Accessibility access was enabled for with-accessibility-access, but it is not safe to disable') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'test_helper' | ||
|
||
# todo: this test should be named after the corresponding class, once | ||
# that class is abstracted from installer.rb. It makes little sense | ||
# to be invoking bundle_identifier off of the installer instance. | ||
describe "Operations on staged Casks" do | ||
describe "bundle ID" do | ||
it "fetches the bundle ID from a staged cask" do | ||
transmission_cask = Cask.load('local-transmission') | ||
tr_installer = Cask::Installer.new(transmission_cask) | ||
|
||
shutup do | ||
tr_installer.install | ||
end | ||
tr_installer.bundle_identifier.must_equal('org.m0k.transmission') | ||
end | ||
end | ||
end |
Oops, something went wrong.