rename mocks to mock
This commit is contained in:
parent
6090d36559
commit
1426102e67
|
@ -1,5 +1,5 @@
|
||||||
use crate::{AnimationFrames, Image, Position};
|
use crate::{AnimationFrames, Image, Position};
|
||||||
use crate::mocks;
|
use crate::mock;
|
||||||
|
|
||||||
/// avatar is a "sprite" in the game data but with a specific id
|
/// avatar is a "sprite" in the game data but with a specific id
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
|
@ -45,10 +45,10 @@ fn test_avatar_from_string() {
|
||||||
include_str!("../test/resources/avatar").to_string()
|
include_str!("../test/resources/avatar").to_string()
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(output, mocks::avatar());
|
assert_eq!(output, mock::avatar());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_avatar_to_string() {
|
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)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
|
@ -61,7 +61,7 @@ fn test_image_from_string() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_image_to_string() {
|
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();
|
let expected = include_str!("../test/resources/image-chequers-1").to_string();
|
||||||
assert_eq!(output, expected);
|
assert_eq!(output, expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{AnimationFrames, Image, mocks};
|
use crate::{AnimationFrames, Image, mock};
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub struct Item {
|
pub struct Item {
|
||||||
|
@ -56,13 +56,13 @@ impl ToString for Item {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_item_from_string() {
|
fn test_item_from_string() {
|
||||||
let output = Item::from(include_str!("../test/resources/item").to_string());
|
let output = Item::from(include_str!("../test/resources/item").to_string());
|
||||||
let expected = mocks::item();
|
let expected = mock::item();
|
||||||
assert_eq!(output, expected);
|
assert_eq!(output, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_item_to_string() {
|
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();
|
let expected = include_str!("../test/resources/item").to_string();
|
||||||
assert_eq!(output, expected);
|
assert_eq!(output, expected);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ pub mod exit;
|
||||||
pub mod palette;
|
pub mod palette;
|
||||||
pub mod image;
|
pub mod image;
|
||||||
pub mod item;
|
pub mod item;
|
||||||
pub mod mocks;
|
pub mod mock;
|
||||||
pub mod position;
|
pub mod position;
|
||||||
pub mod sprite;
|
pub mod sprite;
|
||||||
pub mod tile;
|
pub mod tile;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use crate::{AnimationFrames, Image, Position, mocks};
|
use crate::{AnimationFrames, Image, Position, mock};
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub struct Sprite {
|
pub struct Sprite {
|
||||||
|
@ -73,12 +73,12 @@ fn test_sprite_from_string() {
|
||||||
include_str!("../test/resources/sprite").to_string()
|
include_str!("../test/resources/sprite").to_string()
|
||||||
);
|
);
|
||||||
|
|
||||||
let expected = mocks::sprite();
|
let expected = mock::sprite();
|
||||||
|
|
||||||
assert_eq!(output, expected);
|
assert_eq!(output, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sprite_to_string() {
|
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::AnimationFrames;
|
||||||
use crate::image::Image;
|
use crate::image::Image;
|
||||||
use crate::mocks;
|
use crate::mock;
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
pub struct Tile {
|
pub struct Tile {
|
||||||
|
@ -82,8 +82,8 @@ fn test_tile_to_string() {
|
||||||
name: Some("chequers".to_string()),
|
name: Some("chequers".to_string()),
|
||||||
wall: false,
|
wall: false,
|
||||||
animation_frames: vec![
|
animation_frames: vec![
|
||||||
mocks::image::chequers_1(),
|
mock::image::chequers_1(),
|
||||||
mocks::image::chequers_2(),
|
mock::image::chequers_2(),
|
||||||
]
|
]
|
||||||
}.to_string();
|
}.to_string();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue