1- require " ../integration_helper "
1+ require " ./spec_helper "
22
3- class CheckCommandTest < Minitest::Test
4- def test_succeeds_when_all_dependencies_are_installed
3+ describe " check " do
4+ it " succeeds when all dependencies are installed " do
55 metadata = {
66 dependencies: {web: " *" , orm: " *" },
77 development_dependencies: {mock: " *" },
@@ -12,7 +12,7 @@ class CheckCommandTest < Minitest::Test
1212 end
1313 end
1414
15- def test_succeeds_when_dependencies_match_loose_requirements
15+ it " succeeds when dependencies match loose requirements " do
1616 with_shard({dependencies: {web: " 1.2.0" }}) do
1717 run " shards install"
1818 end
@@ -22,21 +22,21 @@ class CheckCommandTest < Minitest::Test
2222 end
2323 end
2424
25- def test_fails_without_lockfile
25+ it " fails without lockfile " do
2626 with_shard({dependencies: {web: " *" }}) do
27- ex = assert_raises (FailedCommand ) { run " shards check --no-color" }
28- assert_match " Missing #{ Shards ::LOCK_FILENAME } " , ex.stdout
29- assert_empty ex.stderr
27+ ex = expect_raises (FailedCommand ) { run " shards check --no-color" }
28+ ex.stdout.should contain( " Missing #{ Shards ::LOCK_FILENAME } " )
29+ ex.stderr.should be_empty
3030 end
3131 end
3232
33- def test_succeeds_without_dependencies_and_lockfile
33+ it " succeeds without dependencies and lockfile " do
3434 with_shard({name: " no_dependencies" }) do
3535 run " shards check --no-color"
3636 end
3737 end
3838
39- def test_fails_when_dependencies_are_missing
39+ it " fails when dependencies are missing " do
4040 with_shard({dependencies: {web: " *" }}) do
4141 run " shards install"
4242 end
@@ -46,21 +46,21 @@ class CheckCommandTest < Minitest::Test
4646 development_dependencies: {mock: " *" },
4747 }
4848 with_shard(metadata) do
49- ex = assert_raises (FailedCommand ) { run " shards check --no-color" }
50- assert_match " Dependencies aren't satisfied" , ex.stdout
51- assert_empty ex.stderr
49+ ex = expect_raises (FailedCommand ) { run " shards check --no-color" }
50+ ex.stdout.should contain( " Dependencies aren't satisfied" )
51+ ex.stderr.should be_empty
5252 end
5353 end
5454
55- def test_fails_when_wrong_versions_are_installed
55+ it " fails when wrong versions are installed " do
5656 with_shard({dependencies: {web: " 1.0.0" }}) do
5757 run " shards install"
5858 end
5959
6060 with_shard({dependencies: {web: " 2.0.0" }}) do
61- ex = assert_raises (FailedCommand ) { run " shards check --no-color" }
62- assert_match " Dependencies aren't satisfied" , ex.stdout
63- assert_empty ex.stderr
61+ ex = expect_raises (FailedCommand ) { run " shards check --no-color" }
62+ ex.stdout.should contain( " Dependencies aren't satisfied" )
63+ ex.stderr.should be_empty
6464 end
6565 end
6666end
0 commit comments