aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/advisory/auditor_test.rs4
-rw-r--r--crates/shirabe/tests/command/bump_command_test.rs2
-rw-r--r--crates/shirabe/tests/command/init_command_test.rs2
-rw-r--r--crates/shirabe/tests/command/remove_command_test.rs2
-rw-r--r--crates/shirabe/tests/command/repository_command_test.rs2
-rw-r--r--crates/shirabe/tests/command/require_command_test.rs2
-rw-r--r--crates/shirabe/tests/json/json_file_test.rs2
7 files changed, 8 insertions, 8 deletions
diff --git a/crates/shirabe/tests/advisory/auditor_test.rs b/crates/shirabe/tests/advisory/auditor_test.rs
index 65e848dd..e3b72536 100644
--- a/crates/shirabe/tests/advisory/auditor_test.rs
+++ b/crates/shirabe/tests/advisory/auditor_test.rs
@@ -190,8 +190,8 @@ impl RepositoryInterface for MockAdvisoryRepository {
) -> anyhow::Result<IndexMap<String, ProviderInfo>> {
unimplemented!("not used by Auditor")
}
- fn get_repo_name(&self) -> String {
- "mock advisory repo".to_string()
+ fn get_repo_name(&self) -> anyhow::Result<String> {
+ Ok("mock advisory repo".to_string())
}
fn as_advisory_provider_mut(&mut self) -> Option<&mut dyn AdvisoryProviderInterface> {
Some(self)
diff --git a/crates/shirabe/tests/command/bump_command_test.rs b/crates/shirabe/tests/command/bump_command_test.rs
index d511f2a1..14ac17a6 100644
--- a/crates/shirabe/tests/command/bump_command_test.rs
+++ b/crates/shirabe/tests/command/bump_command_test.rs
@@ -41,7 +41,7 @@ fn run_bump_case(
let status_code = app_tester.run(input, RunOptions::default()).unwrap();
assert_eq!(exit_code, status_code);
- let mut json = JsonFile::new("./composer.json".to_string(), None, None).unwrap();
+ let json = JsonFile::new("./composer.json".to_string(), None, None).unwrap();
let read = json.read().unwrap();
let actual: serde_json::Value =
serde_json::from_str(&JsonFile::encode(&read).unwrap()).unwrap();
diff --git a/crates/shirabe/tests/command/init_command_test.rs b/crates/shirabe/tests/command/init_command_test.rs
index 57777e35..914680fb 100644
--- a/crates/shirabe/tests/command/init_command_test.rs
+++ b/crates/shirabe/tests/command/init_command_test.rs
@@ -23,7 +23,7 @@ fn default_authors() -> serde_json::Value {
/// `serde_json::Value` so the comparison ignores object key order (matching PHPUnit's `assertEquals`
/// on arrays) while staying order-sensitive for lists.
fn read_composer_json(dir: &std::path::Path) -> serde_json::Value {
- let mut file = JsonFile::new(
+ let file = JsonFile::new(
dir.join("composer.json").to_string_lossy().to_string(),
None,
None,
diff --git a/crates/shirabe/tests/command/remove_command_test.rs b/crates/shirabe/tests/command/remove_command_test.rs
index 7b195746..9139bf26 100644
--- a/crates/shirabe/tests/command/remove_command_test.rs
+++ b/crates/shirabe/tests/command/remove_command_test.rs
@@ -26,7 +26,7 @@ fn input(pairs: Vec<(&str, PhpMixed)>) -> Vec<(PhpMixed, PhpMixed)> {
/// Read a JSON file in the CWD and decode it to a `serde_json::Value`.
fn read_json_file(path: &str) -> serde_json::Value {
- let mut json = JsonFile::new(path.to_string(), None, None).unwrap();
+ let json = JsonFile::new(path.to_string(), None, None).unwrap();
let read = json.read().unwrap();
serde_json::from_str(&JsonFile::encode(&read).unwrap()).unwrap()
}
diff --git a/crates/shirabe/tests/command/repository_command_test.rs b/crates/shirabe/tests/command/repository_command_test.rs
index 48ca301a..36b74cc8 100644
--- a/crates/shirabe/tests/command/repository_command_test.rs
+++ b/crates/shirabe/tests/command/repository_command_test.rs
@@ -7,7 +7,7 @@ use shirabe_php_shim::PhpMixed;
/// Read the composer.json in the CWD and decode it.
fn read_composer_json() -> serde_json::Value {
- let mut json = JsonFile::new("./composer.json".to_string(), None, None).unwrap();
+ let json = JsonFile::new("./composer.json".to_string(), None, None).unwrap();
let read = json.read().unwrap();
serde_json::from_str(&JsonFile::encode(&read).unwrap()).unwrap()
}
diff --git a/crates/shirabe/tests/command/require_command_test.rs b/crates/shirabe/tests/command/require_command_test.rs
index 4237c4f8..2a9a0411 100644
--- a/crates/shirabe/tests/command/require_command_test.rs
+++ b/crates/shirabe/tests/command/require_command_test.rs
@@ -382,7 +382,7 @@ fn test_inconsistent_require_keys() {
app_tester.get_display()
);
- let mut composer_content =
+ let composer_content =
JsonFile::new(format!("{}/composer.json", dir.display()), None, None).unwrap();
let content = composer_content.read().unwrap();
let content: serde_json::Value =
diff --git a/crates/shirabe/tests/json/json_file_test.rs b/crates/shirabe/tests/json/json_file_test.rs
index 7aac35a9..785b4721 100644
--- a/crates/shirabe/tests/json/json_file_test.rs
+++ b/crates/shirabe/tests/json/json_file_test.rs
@@ -209,7 +209,7 @@ fn test_preserve_indentation_after_read() {
let dst = fixture_path("tabs2.json");
std::fs::copy(&src, &dst).unwrap();
- let mut json_file = JsonFile::new(dst.to_str().unwrap().to_string(), None, None).unwrap();
+ let json_file = JsonFile::new(dst.to_str().unwrap().to_string(), None, None).unwrap();
let _data = json_file.read().unwrap();
let mut hash: IndexMap<String, PhpMixed> = IndexMap::new();
hash.insert("foo".to_string(), PhpMixed::String("baz".to_string()));