fix tests for new behaviour

This commit is contained in:
maul.esel 2013-09-10 19:25:16 +02:00
parent 06fb31544f
commit 39c0d125bb
1 changed files with 14 additions and 19 deletions

View File

@ -273,22 +273,19 @@ CONTENT
end
end
context "when invalid" do
setup do
@gist = "mattr-24081a1d93d2898ecf0f"
@filename = "myfile.ext"
content = <<CONTENT
should "raise SyntaxError when invalid" do
@gist = "mattr-24081a1d93d2898ecf0f"
@filename = "myfile.ext"
content = <<CONTENT
---
title: My Cool Gist
---
{% gist #{@gist} #{@filename} %}
CONTENT
create_post(content, {'permalink' => '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 = <<CONTENT
---
title: My Cool Gist
@ -321,16 +318,15 @@ title: My Cool Gist
{% gist %}
CONTENT
create_post(content, {'permalink' => '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 = <<CONTENT
---
@ -339,11 +335,10 @@ title: My Cool Gist
{% gist #{invalid_gist} %}
CONTENT
create_post(content, {'permalink' => '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