Change exectuable to executable

This commit is contained in:
Maciej Goszczycki
2017-05-23 01:19:42 +01:00
parent 27cbbbaeea
commit 2a69844e0d
+3 -3
View File
@@ -53,7 +53,7 @@ impl CFBundle {
}
}
pub fn exectuable_url(&self) -> Option<CFURL> {
pub fn executable_url(&self) -> Option<CFURL> {
unsafe {
let exe_url = CFBundleCopyExecutableURL(self.0);
if exe_url.is_null() {
@@ -68,13 +68,13 @@ impl CFBundle {
impl_TCFType!(CFBundle, CFBundleRef, CFBundleGetTypeID);
#[test]
fn safari_exectuable_url() {
fn safari_executable_url() {
use string::CFString;
use url::{CFURL, kCFURLPOSIXPathStyle};
let cfstr_path = CFString::from_static_string("/Applications/Safari.app");
let cfurl_path = CFURL::from_file_system_path(cfstr_path, kCFURLPOSIXPathStyle, true);
let cfurl_executable = CFBundle::new(cfurl_path).expect("Safari not present").exectuable_url();
let cfurl_executable = CFBundle::new(cfurl_path).expect("Safari not present").executable_url();
assert!(cfurl_executable.is_some());
assert_eq!(cfurl_executable.unwrap().absolute().get_file_system_path(kCFURLPOSIXPathStyle).to_string(),
"/Applications/Safari.app/Contents/MacOS/Safari");