-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegration.bats
58 lines (47 loc) · 1.02 KB
/
integration.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bats
setup() {
[ "$CI" = "true" ] && return
[ -d "semantic-rs" ] || git clone https://github.com/semantic-rs/semantic-rs
pushd semantic-rs
git pull
cargo build
popd
}
@test "it runs" {
run semantic-rs
[ "$status" -eq 1 ]
}
@test "fails without Cargo.toml" {
cd fixtures/empty-dir
run semantic-rs
[ "$status" -eq 1 ]
}
@test "fails on non-git directories" {
skip
cd fixtures/not-a-repo
run semantic-rs
[ "$status" -eq 1 ]
}
@test "fails with broken Cargo.toml" {
cd fixtures/broken-cargo-toml
run semantic-rs
[ "$status" -eq 1 ]
}
@test "Initializes to v1.0.0" {
cd fixtures/initial-release
git reset --hard master
run semantic-rs
[ "$status" -eq 0 ]
run grep -q 'version = "1.0.0"' Cargo.toml
[ "$status" -eq 0 ]
}
@test "Bumps to next minor" {
cd fixtures/next-minor
git reset --hard master
run grep -q 'version = "1.0.0"' Cargo.toml
[ "$status" -eq 0 ]
run semantic-rs
[ "$status" -eq 0 ]
run grep -q 'version = "1.1.0"' Cargo.toml
[ "$status" -eq 0 ]
}