From 39c0d125bbb34d42f01b8fbd5ce50d91a6693360 Mon Sep 17 00:00:00 2001 From: "maul.esel" Date: Tue, 10 Sep 2013 19:25:16 +0200 Subject: [PATCH] fix tests for new behaviour --- test/test_tags.rb | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) 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