Skip to content

Commit 7e29398

Browse files
inureyesclaude
andcommitted
fix: add missing fields to InteractiveCommand struct initialization in tests
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5b24835 commit 7e29398

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

examples/interactive_demo.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! Example demonstrating interactive mode usage with bssh
1616
1717
use bssh::commands::interactive::InteractiveCommand;
18-
use bssh::config::Config;
18+
use bssh::config::{Config, InteractiveConfig};
1919
use bssh::node::Node;
2020
use std::path::PathBuf;
2121

@@ -46,6 +46,8 @@ async fn main() -> anyhow::Result<()> {
4646
work_dir: None,
4747
nodes,
4848
config: Config::default(),
49+
interactive_config: InteractiveConfig::default(),
50+
cluster_name: None,
4951
};
5052

5153
println!("Starting interactive session...");

src/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub enum InteractiveMode {
8181
Multiplex,
8282
}
8383

84-
8584
fn default_interactive_mode() -> InteractiveMode {
8685
InteractiveMode::SingleNode
8786
}

tests/interactive_integration_test.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! Integration tests for interactive mode
1616
1717
use bssh::commands::interactive::InteractiveCommand;
18-
use bssh::config::Config;
18+
use bssh::config::{Config, InteractiveConfig};
1919
use bssh::node::Node;
2020
use std::path::PathBuf;
2121
use std::sync::Arc;
@@ -39,6 +39,8 @@ fn test_interactive_command_builder() {
3939
work_dir: Some("/tmp".to_string()),
4040
nodes,
4141
config: Config::default(),
42+
interactive_config: InteractiveConfig::default(),
43+
cluster_name: None,
4244
};
4345

4446
assert!(!cmd.single_node);
@@ -62,6 +64,8 @@ fn test_history_file_handling() {
6264
work_dir: None,
6365
nodes: vec![],
6466
config: Config::default(),
67+
interactive_config: InteractiveConfig::default(),
68+
cluster_name: None,
6569
};
6670

6771
assert_eq!(cmd.history_file, history_path);
@@ -148,6 +152,8 @@ async fn test_interactive_with_unreachable_nodes() {
148152
work_dir: None,
149153
nodes,
150154
config: Config::default(),
155+
interactive_config: InteractiveConfig::default(),
156+
cluster_name: None,
151157
};
152158

153159
// This should fail to connect
@@ -171,6 +177,8 @@ async fn test_interactive_with_no_nodes() {
171177
work_dir: None,
172178
nodes: vec![],
173179
config: Config::default(),
180+
interactive_config: InteractiveConfig::default(),
181+
cluster_name: None,
174182
};
175183

176184
let result = cmd.execute().await;
@@ -204,6 +212,8 @@ fn test_mode_configuration() {
204212
work_dir: None,
205213
nodes: nodes.clone(),
206214
config: Config::default(),
215+
interactive_config: InteractiveConfig::default(),
216+
cluster_name: None,
207217
};
208218

209219
assert!(single_cmd.single_node);
@@ -218,6 +228,8 @@ fn test_mode_configuration() {
218228
work_dir: None,
219229
nodes,
220230
config: Config::default(),
231+
interactive_config: InteractiveConfig::default(),
232+
cluster_name: None,
221233
};
222234

223235
assert!(!multi_cmd.single_node);
@@ -235,6 +247,8 @@ fn test_working_directory_config() {
235247
work_dir: Some("/var/www".to_string()),
236248
nodes: vec![],
237249
config: Config::default(),
250+
interactive_config: InteractiveConfig::default(),
251+
cluster_name: None,
238252
};
239253

240254
assert_eq!(cmd_with_dir.work_dir, Some("/var/www".to_string()));
@@ -247,6 +261,8 @@ fn test_working_directory_config() {
247261
work_dir: None,
248262
nodes: vec![],
249263
config: Config::default(),
264+
interactive_config: InteractiveConfig::default(),
265+
cluster_name: None,
250266
};
251267

252268
assert_eq!(cmd_without_dir.work_dir, None);
@@ -271,6 +287,8 @@ fn test_prompt_format() {
271287
work_dir: None,
272288
nodes: vec![],
273289
config: Config::default(),
290+
interactive_config: InteractiveConfig::default(),
291+
cluster_name: None,
274292
};
275293

276294
assert_eq!(cmd.prompt_format, format);

tests/interactive_test.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
use bssh::commands::interactive::InteractiveCommand;
16-
use bssh::config::Config;
16+
use bssh::config::{Config, InteractiveConfig};
1717
use bssh::node::Node;
1818
use std::path::PathBuf;
1919

@@ -27,6 +27,8 @@ async fn test_interactive_command_creation() {
2727
work_dir: None,
2828
nodes: vec![],
2929
config: Config::default(),
30+
interactive_config: InteractiveConfig::default(),
31+
cluster_name: None,
3032
};
3133

3234
assert!(!cmd.single_node);
@@ -44,6 +46,8 @@ async fn test_interactive_with_no_nodes() {
4446
work_dir: None,
4547
nodes: vec![],
4648
config: Config::default(),
49+
interactive_config: InteractiveConfig::default(),
50+
cluster_name: None,
4751
};
4852

4953
let result = cmd.execute().await;

0 commit comments

Comments
 (0)