Skip to content

Commit

Permalink
Don't pin fake and quickcheck to older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeMathWalker committed Aug 29, 2024
1 parent aae7963 commit a1fb2b8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 96 deletions.
130 changes: 39 additions & 91 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ actix-session = { version = "0.10", features = ["redis-session-rustls"] }
serde_json = "1"

[dev-dependencies]
quickcheck = "0.9.2"
quickcheck_macros = "0.9.1"
fake = "~2.3.0"
quickcheck = "1.0.3"
quickcheck_macros = "1"
fake = "2.9"
wiremock = "0.6"
serde_json = "1.0.61"
serde_urlencoded = "0.7.1"
Expand Down
8 changes: 6 additions & 2 deletions src/domain/subscriber_email.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ mod tests {
use claims::assert_err;
use fake::faker::internet::en::SafeEmail;
use fake::Fake;
use rand::rngs::StdRng;
use rand::SeedableRng;

#[test]
fn empty_string_is_rejected() {
Expand All @@ -54,8 +56,10 @@ mod tests {
struct ValidEmailFixture(pub String);

impl quickcheck::Arbitrary for ValidEmailFixture {
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
let email = SafeEmail().fake_with_rng(g);
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
let mut rng = StdRng::seed_from_u64(u64::arbitrary(g));
let email = SafeEmail().fake_with_rng(&mut rng);

Self(email)
}
}
Expand Down

0 comments on commit a1fb2b8

Please sign in to comment.