|
8 | 8 | doc.output = Jekyll::Renderer.new(doc.site, doc).run
|
9 | 9 | end
|
10 | 10 |
|
11 |
| - context "simple gist" do |
12 |
| - let(:gist) { 358471 } |
13 | 11 |
|
14 |
| - it "produces the correct script tag" do |
15 |
| - expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/) |
16 |
| - end |
17 |
| - end |
| 12 | + context "valid gist" do |
| 13 | + context "with user prefix" do |
| 14 | + let(:gist) { "mattr-/24081a1d93d2898ecf0f" } |
18 | 15 |
|
19 |
| - context "private gist" do |
| 16 | + it "produces the correct script tag" do |
| 17 | + expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/) |
| 18 | + end |
| 19 | + end |
20 | 20 |
|
21 |
| - context "when valid" do |
22 |
| - let(:gist) { "mattr-/24081a1d93d2898ecf0f" } |
| 21 | + context "without user prefix" do |
| 22 | + let(:gist) { "28949e1d5ee2273f9fd3" } |
23 | 23 |
|
24 | 24 | it "produces the correct script tag" do
|
25 | 25 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js">\s<\/script>/)
|
|
35 | 35 | expect(output).to match(/<script src="https:\/\/gist.github.com\/#{gist}.js\?file=#{filename}">\s<\/script>/)
|
36 | 36 | end
|
37 | 37 | end
|
| 38 | + end |
| 39 | + |
38 | 40 |
|
39 |
| - context "when invalid" do |
40 |
| - let(:gist) { "mattr-24081a1d93d2898ecf0f" } |
| 41 | + context "invalid gist" do |
| 42 | + |
| 43 | + context "no gist id present" do |
| 44 | + let(:gist) { "" } |
41 | 45 |
|
42 | 46 | it "raises an error" do
|
43 | 47 | expect(->{ output }).to raise_error
|
|
46 | 50 |
|
47 | 51 | end
|
48 | 52 |
|
49 |
| - context "no gist id present" do |
50 |
| - let(:gist) { "" } |
51 |
| - |
52 |
| - it "raises an error" do |
53 |
| - expect(->{ output }).to raise_error |
54 |
| - end |
55 |
| - end |
56 |
| - |
57 | 53 | end
|
0 commit comments