Skip to content

Commit c092bda

Browse files
committed
Fix docker-compose test url
1 parent 08a4524 commit c092bda

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/documents.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ mod tests {
526526

527527
#[meilisearch_test]
528528
async fn test_get_documents_with_error_hint() -> Result<(), Error> {
529-
let url = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
530-
let client = Client::new(format!("{}/hello", url), Some("masterKey"));
529+
let meilisearch_url = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
530+
let client = Client::new(format!("{}/hello", meilisearch_url), Some("masterKey"));
531531
let index = client.index("test_get_documents_with_filter_wrong_ms_version");
532532

533533
let documents = DocumentsQuery::new(&index)
@@ -538,9 +538,11 @@ mod tests {
538538
let error = documents.unwrap_err();
539539

540540
let message = Some("Hint: It might not be working because you're not up to date with the Meilisearch version that updated the get_documents_with method.".to_string());
541-
let url = "http://localhost:7700/hello/indexes/test_get_documents_with_filter_wrong_ms_version/documents/fetch".to_string();
541+
let url = format!(
542+
"{meilisearch_url}/hello/indexes/test_get_documents_with_filter_wrong_ms_version/documents/fetch"
543+
);
542544
let status_code = 404;
543-
let displayed_error = "MeilisearchCommunicationError: The server responded with a 404. Hint: It might not be working because you're not up to date with the Meilisearch version that updated the get_documents_with method.\nurl: http://localhost:7700/hello/indexes/test_get_documents_with_filter_wrong_ms_version/documents/fetch";
545+
let displayed_error = format!("MeilisearchCommunicationError: The server responded with a 404. Hint: It might not be working because you're not up to date with the Meilisearch version that updated the get_documents_with method.\nurl: {meilisearch_url}/hello/indexes/test_get_documents_with_filter_wrong_ms_version/documents/fetch");
544546

545547
match &error {
546548
Error::MeilisearchCommunication(error) => {

src/settings.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ impl Index {
609609
/// ```
610610
/// # use meilisearch_sdk::{client::*, indexes::*};
611611
/// #
612-
/// # let MEILISEARCH_HOST = option_env!("MEILISEARCH_HOST").unwrap_or("http://localhost:7700");
612+
/// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
613613
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
614614
/// #
615615
/// # futures::executor::block_on(async move {
616-
/// let client = Client::new(MEILISEARCH_HOST, Some(MEILISEARCH_API_KEY));
616+
/// let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
617617
/// # client.create_index("get_typo_tolerance", None).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
618618
/// let index = client.index("get_typo_tolerance");
619619
///
@@ -1096,11 +1096,11 @@ impl Index {
10961096
/// ```
10971097
/// # use meilisearch_sdk::{client::*, indexes::*, settings::Settings, settings::{TypoToleranceSettings, MinWordSizeForTypos}};
10981098
/// #
1099-
/// # let MEILISEARCH_HOST = option_env!("MEILISEARCH_HOST").unwrap_or("http://localhost:7700");
1099+
/// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
11001100
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
11011101
/// #
11021102
/// # futures::executor::block_on(async move {
1103-
/// let client = Client::new(MEILISEARCH_HOST, Some(MEILISEARCH_API_KEY));
1103+
/// let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
11041104
/// # client.create_index("set_typo_tolerance", None).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
11051105
/// let mut index = client.index("set_typo_tolerance");
11061106
///
@@ -1494,11 +1494,11 @@ impl Index {
14941494
/// ```
14951495
/// # use meilisearch_sdk::{client::*, indexes::*, settings::Settings};
14961496
/// #
1497-
/// # let MEILISEARCH_HOST = option_env!("MEILISEARCH_HOST").unwrap_or("http://localhost:7700");
1497+
/// # let MEILISEARCH_URL = option_env!("MEILISEARCH_URL").unwrap_or("http://localhost:7700");
14981498
/// # let MEILISEARCH_API_KEY = option_env!("MEILISEARCH_API_KEY").unwrap_or("masterKey");
14991499
/// #
15001500
/// # futures::executor::block_on(async move {
1501-
/// let client = Client::new(MEILISEARCH_HOST, Some(MEILISEARCH_API_KEY));
1501+
/// let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY));
15021502
/// # client.create_index("reset_typo_tolerance", None).await.unwrap().wait_for_completion(&client, None, None).await.unwrap();
15031503
/// let mut index = client.index("reset_typo_tolerance");
15041504
///

0 commit comments

Comments
 (0)