fix tests for new behaviour
This commit is contained in:
parent
06fb31544f
commit
39c0d125bb
|
@ -273,8 +273,7 @@ CONTENT
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when invalid" do
|
should "raise SyntaxError when invalid" do
|
||||||
setup do
|
|
||||||
@gist = "mattr-24081a1d93d2898ecf0f"
|
@gist = "mattr-24081a1d93d2898ecf0f"
|
||||||
@filename = "myfile.ext"
|
@filename = "myfile.ext"
|
||||||
content = <<CONTENT
|
content = <<CONTENT
|
||||||
|
@ -284,11 +283,9 @@ CONTENT
|
||||||
|
|
||||||
{% gist #{@gist} #{@filename} %}
|
{% gist #{@gist} #{@filename} %}
|
||||||
CONTENT
|
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_raise SyntaxError do
|
||||||
assert_match "Error parsing gist id", @result
|
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -313,7 +310,7 @@ CONTENT
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with blank gist id" do
|
context "with blank gist id" do
|
||||||
setup do
|
should "raise SyntaxError" do
|
||||||
content = <<CONTENT
|
content = <<CONTENT
|
||||||
---
|
---
|
||||||
title: My Cool Gist
|
title: My Cool Gist
|
||||||
|
@ -321,16 +318,15 @@ title: My Cool Gist
|
||||||
|
|
||||||
{% gist %}
|
{% gist %}
|
||||||
CONTENT
|
CONTENT
|
||||||
|
|
||||||
|
assert_raise SyntaxError do
|
||||||
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
||||||
end
|
end
|
||||||
|
|
||||||
should "output error message" do
|
|
||||||
assert_match "Error parsing gist id", @result
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with invalid gist id" do
|
context "with invalid gist id" do
|
||||||
setup do
|
should "raise SyntaxError" do
|
||||||
invalid_gist = 'invalid'
|
invalid_gist = 'invalid'
|
||||||
content = <<CONTENT
|
content = <<CONTENT
|
||||||
---
|
---
|
||||||
|
@ -339,11 +335,10 @@ title: My Cool Gist
|
||||||
|
|
||||||
{% gist #{invalid_gist} %}
|
{% gist #{invalid_gist} %}
|
||||||
CONTENT
|
CONTENT
|
||||||
|
|
||||||
|
assert_raise SyntaxError do
|
||||||
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true})
|
||||||
end
|
end
|
||||||
|
|
||||||
should "output error message" do
|
|
||||||
assert_match "Error parsing gist id", @result
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue