vanilla 1.17.13 → 2.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,10 @@ require "test_helper"
3
3
  context "The index dynasnip" do
4
4
  should "render links to every snip with the most recently updated first" do
5
5
  app.soup.stubs(:all_snips).returns([
6
- snip(:name => "alpha", :updated_at => Time.at(10)),
7
- snip(:name => "beta", :updated_at => Time.at(20)),
8
- snip(:name => "gamma", :updated_at => Time.at(40)),
9
- snip(:name => "delta", :updated_at => Time.at(30))
6
+ snip(name: "alpha", updated_at: Time.at(10)),
7
+ snip(name: "beta", updated_at: Time.at(20)),
8
+ snip(name: "gamma", updated_at: Time.at(40)),
9
+ snip(name: "delta", updated_at: Time.at(30))
10
10
  ])
11
11
 
12
12
  visit "/index"
@@ -16,9 +16,9 @@ context "The index dynasnip" do
16
16
 
17
17
  should "order snips without updated_at as if they were updated a long time ago" do
18
18
  app.soup.stubs(:all_snips).returns([
19
- snip(:name => "alpha", :updated_at => Time.at(10)),
20
- snip(:name => "beta", :updated_at => Time.at(20)),
21
- snip(:name => "gamma")
19
+ snip(name: "alpha", updated_at: Time.at(10)),
20
+ snip(name: "beta", updated_at: Time.at(20)),
21
+ snip(name: "gamma")
22
22
  ])
23
23
 
24
24
  visit "/index"
@@ -28,7 +28,7 @@ context "The index dynasnip" do
28
28
 
29
29
  should "render links to snips with weird characters and spaces" do
30
30
  app.soup.stubs(:all_snips).returns([
31
- snip(:name => "fun fun", :updated_at => Time.at(20))
31
+ snip(name: "fun fun", updated_at: Time.at(20))
32
32
  ])
33
33
 
34
34
  visit "/index"
@@ -2,10 +2,10 @@ require "test_helper"
2
2
 
3
3
  context "The link_to_current_snip dynasnip" do
4
4
  should "create a link to the snip that was requested" do
5
- create_snip :name => "a", :content => "{b}"
6
- create_snip :name => "b", :content => "<div id='x'>{link_to_current_snip}</div>"
5
+ create_snip name: "a", content: "{b}"
6
+ create_snip name: "b", content: "<div id='x'>{link_to_current_snip}</div>"
7
7
 
8
8
  visit "/a"
9
9
  assert page.has_css?("#x a[href='/a']")
10
10
  end
11
- end
11
+ end
@@ -2,26 +2,26 @@ require "test_helper"
2
2
 
3
3
  context "The link_to dynasnip" do
4
4
  should "render a link to the given snip using the snip name as text" do
5
- create_snip :name => "test", :content => "<div id='x'>this is a {link_to test}.</div>"
5
+ create_snip name: "test", content: "<div id='x'>this is a {link_to test}.</div>"
6
6
  visit "/test"
7
7
  assert page.find("#x a[href='/test']").has_content?('test')
8
8
  end
9
9
 
10
10
  should "render a link to the given snip using custom link text" do
11
- create_snip :name => "test", :content => "<div id='x'>this is a {link_to test, my link}.</div>"
11
+ create_snip name: "test", content: "<div id='x'>this is a {link_to test, my link}.</div>"
12
12
  visit "/test"
13
13
  assert page.find("#x a[href='/test']").has_content?('my link')
14
14
  end
15
15
 
16
16
  should "render a link to the given snip and part" do
17
- create_snip :name => "test", :content => "<div id='x'>this is a {link_to test, test, part}.</div>"
17
+ create_snip name: "test", content: "<div id='x'>this is a {link_to test, test, part}.</div>"
18
18
  visit "/test"
19
19
  assert page.find("#x a[href='/test/part']").has_content?('test')
20
20
  end
21
21
 
22
22
  should "add a 'missing' class where the snip does not exist" do
23
- create_snip :name => "test", :content => "<div id='x'>this is a {link_to blah}.</div>"
23
+ create_snip name: "test", content: "<div id='x'>this is a {link_to blah}.</div>"
24
24
  visit "/test"
25
25
  assert page.find("#x a.missing[href='/blah']")
26
26
  end
27
- end
27
+ end
@@ -3,13 +3,13 @@ require "test_helper"
3
3
  context "The page_title dynasnip" do
4
4
  should "render as the requested snip name if that snip has no title" do
5
5
  visit "/"
6
- assert page.has_css?("head title", :content => "start"), page.source
6
+ assert page.has_css?("head title", text: "start", visible: false), page.source
7
7
  end
8
8
 
9
9
  should "render as the requested snip's page_title when that attribute is present" do
10
- create_snip :name => "test", :content => "test", :page_title => "This is a test"
10
+ create_snip name: "test", content: "test", page_title: "This is a test"
11
11
 
12
12
  visit "/test"
13
- assert page.has_css?("head title", :content => "This is a test")
13
+ assert page.has_css?("head title", text: "This is a test", visible: false), page.source
14
14
  end
15
- end
15
+ end
@@ -2,7 +2,7 @@ require "test_helper"
2
2
 
3
3
  context "The rack app" do
4
4
  should "handle exceptions by default" do
5
- create_snip :name => "test", :content => "test"
5
+ create_snip name: "test", content: "test"
6
6
 
7
7
  app.stubs(:render_in_format).raises("exception-message")
8
8
 
@@ -11,7 +11,7 @@ context "The rack app" do
11
11
  end
12
12
 
13
13
  should "handle exceptions when raise_errors is false" do
14
- create_snip :name => "test", :content => "test"
14
+ create_snip name: "test", content: "test"
15
15
 
16
16
  app.stubs(:render_in_format).raises("exception-message")
17
17
 
@@ -22,7 +22,7 @@ context "The rack app" do
22
22
  end
23
23
 
24
24
  should "raise exceptions when raise_errors is true" do
25
- create_snip :name => "test", :content => "test"
25
+ create_snip name: "test", content: "test"
26
26
 
27
27
  app.stubs(:render_in_format).raises("exception-message")
28
28
 
@@ -32,14 +32,14 @@ context "The rack app" do
32
32
  end
33
33
 
34
34
  should "handle missing renderer by default" do
35
- create_snip :name => "test", :content => "test", :render_as => "unknown"
35
+ create_snip name: "test", content: "test", render_as: "unknown"
36
36
 
37
37
  assert_nothing_raised { visit "/test" }
38
38
  assert_equal 500, page.status_code
39
39
  end
40
40
 
41
41
  should "handle missing renderer when raise_errors is false" do
42
- create_snip :name => "test", :content => "test", :render_as => "unknown"
42
+ create_snip name: "test", content: "test", render_as: "unknown"
43
43
 
44
44
  with_raise_errors(false) do
45
45
  assert_nothing_raised { visit "/test" }
@@ -48,7 +48,7 @@ context "The rack app" do
48
48
  end
49
49
 
50
50
  should "raise exceptions when raise_errors is true" do
51
- create_snip :name => "test", :content => "test", :render_as => "unknown"
51
+ create_snip name: "test", content: "test", render_as: "unknown"
52
52
 
53
53
  with_raise_errors(true) do
54
54
  assert_raises("exception-message") { visit "/test" }
@@ -2,23 +2,23 @@ require "test_helper"
2
2
 
3
3
  context "The raw dynasnip" do
4
4
  should "render the snip given in its raw form" do
5
- create_snip :name => "a", :content => "{b}"
6
- create_snip :name => "test", :content => "<div id='x'>{raw a}</div>"
5
+ create_snip name: "a", content: "{b}"
6
+ create_snip name: "test", content: "<div id='x'>{raw a}</div>"
7
7
  visit "/test"
8
- assert page.has_css?("#x", :content => "&#123;b&#125;")
8
+ assert page.source.include?("<div id='x'>&#123;b&#125;</div>")
9
9
  end
10
10
 
11
11
  should "escape html tags" do
12
- create_snip :name => "a", :content => "<b></b>"
13
- create_snip :name => "test", :content => "<div id='x'>{raw a}</div>"
12
+ create_snip name: "a", content: "<b></b>"
13
+ create_snip name: "test", content: "<div id='x'>{raw a}</div>"
14
14
  visit "/test"
15
- assert page.has_css?("#x", :content => "&lt;b&gt;&lt;/b&gt;")
15
+ assert page.source.include?("<div id='x'>&lt;b&gt;&lt;/b&gt;</div>")
16
16
  end
17
17
 
18
18
  should "render a raw part" do
19
- create_snip :name => "a", :content => "x", :bit => "a<b"
20
- create_snip :name => "test", :content => "<div id='x'>{raw a, bit}</div>"
19
+ create_snip name: "a", content: "x", bit: "a<b"
20
+ create_snip name: "test", content: "<div id='x'>{raw a, bit}</div>"
21
21
  visit "/test"
22
- assert page.has_css?("#x", :content => "a&lt;b")
22
+ assert page.source.include?("<div id='x'>a&lt;b</div>")
23
23
  end
24
- end
24
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanilla
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.13
4
+ version: 2.0.0.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Adam
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-09 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.11
33
+ version: 1.0.13
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.11
40
+ version: 1.0.13
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ratom
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +98,14 @@ dependencies:
98
98
  name: parslet
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: 1.5.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.5.0
111
111
  - !ruby/object:Gem::Dependency
@@ -303,12 +303,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
303
303
  version: '0'
304
304
  required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  requirements:
306
- - - ">="
306
+ - - ">"
307
307
  - !ruby/object:Gem::Version
308
- version: '0'
308
+ version: 1.3.1
309
309
  requirements: []
310
310
  rubyforge_project: vanilla
311
- rubygems_version: 2.4.5
311
+ rubygems_version: 2.5.1
312
312
  signing_key:
313
313
  specification_version: 4
314
314
  summary: A bliki-type web content thing.