@@ -873,7 +873,10 @@ fn yank_not_owner() {
873
873
874
874
#[ test]
875
875
fn yank_max_version ( ) {
876
- #[ derive( RustcDecodable ) ] struct O { ok : bool }
876
+ #[ derive( RustcDecodable ) ]
877
+ struct O {
878
+ ok : bool ,
879
+ }
877
880
let ( _b, app, middle) = :: app ( ) ;
878
881
879
882
// Upload a new crate
@@ -889,67 +892,67 @@ fn yank_max_version() {
889
892
// add version 2.0.0
890
893
let body = :: new_req_body_version_2 ( :: krate ( "fyk_max" ) ) ;
891
894
let mut response = ok_resp ! ( middle. call( req. with_path( "/api/v1/crates/new" )
892
- . with_method( Method :: Put )
893
- . with_body( & body) ) ) ;
895
+ . with_method( Method :: Put )
896
+ . with_body( & body) ) ) ;
894
897
let json: GoodCrate = :: json ( & mut response) ;
895
898
assert ! ( json. krate. max_version. is_some( ) ) ;
896
899
assert_eq ! ( json. krate. max_version. unwrap( ) , "2.0.0" ) ;
897
900
898
901
// yank version 1.0.0
899
902
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Delete )
900
- . with_path( "/api/v1/crates/fyk_max/1.0.0/yank" ) ) ) ;
903
+ . with_path( "/api/v1/crates/fyk_max/1.0.0/yank" ) ) ) ;
901
904
assert ! ( :: json:: <O >( & mut r) . ok) ;
902
905
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
903
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
906
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
904
907
let json: CrateResponse = :: json ( & mut response) ;
905
908
assert ! ( json. krate. max_version. is_some( ) ) ;
906
909
assert_eq ! ( json. krate. max_version. unwrap( ) , "2.0.0" ) ;
907
910
908
911
// unyank version 1.0.0
909
912
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Put )
910
- . with_path( "/api/v1/crates/fyk_max/1.0.0/unyank" ) ) ) ;
913
+ . with_path( "/api/v1/crates/fyk_max/1.0.0/unyank" ) ) ) ;
911
914
assert ! ( :: json:: <O >( & mut r) . ok) ;
912
915
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
913
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
916
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
914
917
let json: CrateResponse = :: json ( & mut response) ;
915
918
assert ! ( json. krate. max_version. is_some( ) ) ;
916
919
assert_eq ! ( json. krate. max_version. unwrap( ) , "2.0.0" ) ;
917
920
918
921
// yank version 2.0.0
919
922
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Delete )
920
- . with_path( "/api/v1/crates/fyk_max/2.0.0/yank" ) ) ) ;
923
+ . with_path( "/api/v1/crates/fyk_max/2.0.0/yank" ) ) ) ;
921
924
assert ! ( :: json:: <O >( & mut r) . ok) ;
922
925
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
923
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
926
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
924
927
let json: CrateResponse = :: json ( & mut response) ;
925
928
assert ! ( json. krate. max_version. is_some( ) ) ;
926
929
assert_eq ! ( json. krate. max_version. unwrap( ) , "1.0.0" ) ;
927
930
928
931
// yank version 1.0.0
929
932
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Delete )
930
- . with_path( "/api/v1/crates/fyk_max/1.0.0/yank" ) ) ) ;
933
+ . with_path( "/api/v1/crates/fyk_max/1.0.0/yank" ) ) ) ;
931
934
assert ! ( :: json:: <O >( & mut r) . ok) ;
932
935
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
933
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
936
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
934
937
let json: CrateResponse = :: json ( & mut response) ;
935
938
assert ! ( json. krate. max_version. is_none( ) ) ;
936
939
937
940
// unyank version 2.0.0
938
941
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Put )
939
- . with_path( "/api/v1/crates/fyk_max/2.0.0/unyank" ) ) ) ;
942
+ . with_path( "/api/v1/crates/fyk_max/2.0.0/unyank" ) ) ) ;
940
943
assert ! ( :: json:: <O >( & mut r) . ok) ;
941
944
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
942
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
945
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
943
946
let json: CrateResponse = :: json ( & mut response) ;
944
947
assert ! ( json. krate. max_version. is_some( ) ) ;
945
948
assert_eq ! ( json. krate. max_version. unwrap( ) , "2.0.0" ) ;
946
949
947
950
// unyank version 1.0.0
948
951
let mut r = ok_resp ! ( middle. call( req. with_method( Method :: Put )
949
- . with_path( "/api/v1/crates/fyk_max/1.0.0/unyank" ) ) ) ;
952
+ . with_path( "/api/v1/crates/fyk_max/1.0.0/unyank" ) ) ) ;
950
953
assert ! ( :: json:: <O >( & mut r) . ok) ;
951
954
let mut response = ok_resp ! ( middle. call( req. with_method( Method :: Get )
952
- . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
955
+ . with_path( "/api/v1/crates/fyk_max" ) ) ) ;
953
956
let json: CrateResponse = :: json ( & mut response) ;
954
957
assert ! ( json. krate. max_version. is_some( ) ) ;
955
958
assert_eq ! ( json. krate. max_version. unwrap( ) , "2.0.0" ) ;
0 commit comments