diff --git a/test/test_tags.rb b/test/test_tags.rb index c58c9c7e..6179077e 100644 --- a/test/test_tags.rb +++ b/test/test_tags.rb @@ -273,22 +273,19 @@ CONTENT end end - context "when invalid" do - setup do - @gist = "mattr-24081a1d93d2898ecf0f" - @filename = "myfile.ext" - content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) - end - should "write script tag with specific file in gist" do - assert_match "Error parsing gist id", @result + assert_raise SyntaxError do + create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) end end end @@ -313,7 +310,7 @@ CONTENT end context "with blank gist id" do - setup do + should "raise SyntaxError" do content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) - end - should "output error message" do - assert_match "Error parsing gist id", @result + assert_raise SyntaxError do + create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) + end end end context "with invalid gist id" do - setup do + should "raise SyntaxError" do invalid_gist = 'invalid' content = < 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) - end - should "output error message" do - assert_match "Error parsing gist id", @result + assert_raise SyntaxError do + create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true}) + end end end end