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

Allow overriding preferences in CLI arguments. #251

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,043 changes: 517 additions & 526 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ termion = "1.5.1"
error-chain = "0.12.4"
unicode-segmentation = "1.0.1"
clipboard = "0.4.4"
yaml-rust = ">= 0.4.5"
smallvec = "0.4.3"
lazy_static = "1.2.0"
mio = "0.6"
linked-hash-map = "0.5.4"

yaml-rust = { git = "https://github.com/lincolnauster/yaml-rust", branch = "all" }

[dependencies.signal-hook]
version = "0.1.9"
Expand Down
12 changes: 6 additions & 6 deletions src/commands/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ mod tests {

#[test]
fn display_available_commands_creates_a_new_buffer() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();
super::display_available_commands(&mut app).unwrap();

assert!(app.workspace.current_buffer().is_some());
}

#[test]
fn display_available_commands_populates_new_buffer_with_alphabetic_command_names() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();
super::display_available_commands(&mut app).unwrap();

let buffer_data = app.workspace.current_buffer().unwrap().data();
Expand All @@ -305,7 +305,7 @@ mod tests {

#[test]
fn switch_to_search_mode_sets_initial_search_query() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();

// A buffer needs to be open to switch to search mode.
let buffer = Buffer::new();
Expand All @@ -326,7 +326,7 @@ mod tests {

#[test]
fn switch_to_path_mode_inserts_workspace_directory_as_default() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();

let buffer = Buffer::new();
app.workspace.add_buffer(buffer);
Expand All @@ -344,7 +344,7 @@ mod tests {

#[test]
fn switch_to_path_mode_inserts_buffer_path_if_one_exists() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();

let mut buffer = Buffer::new();
let absolute_path = format!("{}/test", app.workspace.path.to_string_lossy());
Expand All @@ -364,7 +364,7 @@ mod tests {

#[test]
fn switch_to_path_mode_raises_error_if_no_buffer_is_open() {
let mut app = Application::new(&Vec::new()).unwrap();
let mut app = Application::new(&Vec::new(), Vec::new()).unwrap();

// The application type picks up on test run
// arguments and will open empty buffers for each.
Expand Down
Loading