rename mocks to mock
This commit is contained in:
parent
6090d36559
commit
1426102e67
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue