From 1426102e679be70ff818dd0b419da5f1aeba5afd Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 12 Apr 2020 13:50:07 +0100 Subject: [PATCH] rename mocks to mock --- src/avatar.rs | 6 +++--- src/image.rs | 4 ++-- src/item.rs | 6 +++--- src/lib.rs | 2 +- src/{mocks.rs => mock.rs} | 0 src/sprite.rs | 6 +++--- src/tile.rs | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) rename src/{mocks.rs => mock.rs} (100%) diff --git a/src/avatar.rs b/src/avatar.rs index 341f1bf..01c6d0f 100644 --- a/src/avatar.rs +++ b/src/avatar.rs @@ -1,5 +1,5 @@ use crate::{AnimationFrames, Image, Position}; -use crate::mocks; +use crate::mock; /// avatar is a "sprite" in the game data but with a specific id #[derive(Debug, Eq, PartialEq)] @@ -45,10 +45,10 @@ fn test_avatar_from_string() { include_str!("../test/resources/avatar").to_string() ); - assert_eq!(output, mocks::avatar()); + assert_eq!(output, mock::avatar()); } #[test] fn test_avatar_to_string() { - assert_eq!(mocks::avatar().to_string(), include_str!("../test/resources/avatar")); + assert_eq!(mock::avatar().to_string(), include_str!("../test/resources/avatar")); } diff --git a/src/image.rs b/src/image.rs index 081e630..152834f 100644 --- a/src/image.rs +++ b/src/image.rs @@ -1,4 +1,4 @@ -use crate::mocks; +use crate::mock; #[derive(Debug, Eq, PartialEq)] pub struct Image { @@ -61,7 +61,7 @@ fn test_image_from_string() { #[test] fn test_image_to_string() { - let output = mocks::image::chequers_1().to_string(); + let output = mock::image::chequers_1().to_string(); let expected = include_str!("../test/resources/image-chequers-1").to_string(); assert_eq!(output, expected); } diff --git a/src/item.rs b/src/item.rs index cc96726..1374db0 100644 --- a/src/item.rs +++ b/src/item.rs @@ -1,4 +1,4 @@ -use crate::{AnimationFrames, Image, mocks}; +use crate::{AnimationFrames, Image, mock}; #[derive(Debug, Eq, PartialEq)] pub struct Item { @@ -56,13 +56,13 @@ impl ToString for Item { #[test] fn test_item_from_string() { let output = Item::from(include_str!("../test/resources/item").to_string()); - let expected = mocks::item(); + let expected = mock::item(); assert_eq!(output, expected); } #[test] fn test_item_to_string() { - let output = mocks::item().to_string(); + let output = mock::item().to_string(); let expected = include_str!("../test/resources/item").to_string(); assert_eq!(output, expected); } diff --git a/src/lib.rs b/src/lib.rs index 5b3ab3b..0fefea9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ pub mod exit; pub mod palette; pub mod image; pub mod item; -pub mod mocks; +pub mod mock; pub mod position; pub mod sprite; pub mod tile; diff --git a/src/mocks.rs b/src/mock.rs similarity index 100% rename from src/mocks.rs rename to src/mock.rs diff --git a/src/sprite.rs b/src/sprite.rs index 5746936..2aedeef 100644 --- a/src/sprite.rs +++ b/src/sprite.rs @@ -1,4 +1,4 @@ -use crate::{AnimationFrames, Image, Position, mocks}; +use crate::{AnimationFrames, Image, Position, mock}; #[derive(Debug, Eq, PartialEq)] pub struct Sprite { @@ -73,12 +73,12 @@ fn test_sprite_from_string() { include_str!("../test/resources/sprite").to_string() ); - let expected = mocks::sprite(); + let expected = mock::sprite(); assert_eq!(output, expected); } #[test] fn test_sprite_to_string() { - assert_eq!(mocks::sprite().to_string(), include_str!("../test/resources/sprite").to_string()); + assert_eq!(mock::sprite().to_string(), include_str!("../test/resources/sprite").to_string()); } diff --git a/src/tile.rs b/src/tile.rs index 3e07001..d79009a 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -1,6 +1,6 @@ use crate::AnimationFrames; use crate::image::Image; -use crate::mocks; +use crate::mock; #[derive(Debug, Eq, PartialEq)] pub struct Tile { @@ -82,8 +82,8 @@ fn test_tile_to_string() { name: Some("chequers".to_string()), wall: false, animation_frames: vec![ - mocks::image::chequers_1(), - mocks::image::chequers_2(), + mock::image::chequers_1(), + mock::image::chequers_2(), ] }.to_string();