can-has-lolcat 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/helper.rb ADDED
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'can-has-lolcat'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,34 @@
1
+ require 'helper'
2
+ require 'rr'
3
+
4
+ class TestCanHasLolcat < Test::Unit::TestCase
5
+ include RR::Adapters::TestUnit
6
+
7
+ context "Lolcat" do
8
+ context "#can_has" do
9
+ LOLCAT = /http:\/\/icanhascheezburger\.files\.wordpress\.com\/.+/
10
+
11
+ setup do
12
+ stub(Lolcat).random_from_internetz do
13
+ File.read(File.dirname(__FILE__) + "/fixtures/lolcat.html")
14
+ end
15
+ end
16
+
17
+ should "without any arguments give clean `lolcat` url" do
18
+ assert Lolcat.can_has =~ LOLCAT
19
+ end
20
+
21
+ should "with url as argument sgive clean url" do
22
+ assert Lolcat.can_has(:url) =~ LOLCAT
23
+ end
24
+
25
+ should "with html as argument give HTML formatted `lolcat`" do
26
+ assert Lolcat.can_has(:html) =~ /<img src='.+' alt='' \/>/
27
+ end
28
+
29
+ should "with bbcode as argument give bbcode formatted `lolcat`" do
30
+ assert Lolcat.can_has(:bbcode) =~ /\[img\].+\[\/img\]/
31
+ end
32
+ end
33
+ end
34
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: can-has-lolcat
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Sirupsen
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-18 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: shoulda
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :development
34
+ version_requirements: *id001
35
+ description: Fetches a random lolcat, and returns the appropriate output format.
36
+ email: sirup@sirupsen.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.md
44
+ files:
45
+ - .document
46
+ - .gitignore
47
+ - LICENSE
48
+ - README.md
49
+ - Rakefile
50
+ - VERSION
51
+ - lib/can-has-lolcat.rb
52
+ - test/fixtures/lolcat.html
53
+ - test/helper.rb
54
+ - test/test_can-has-lolcat.rb
55
+ has_rdoc: true
56
+ homepage: http://github.com/Sirupsen/can-has-lolcat
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ requirements: []
83
+
84
+ rubyforge_project:
85
+ rubygems_version: 1.3.7
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: can haz random lolcat?
89
+ test_files:
90
+ - test/test_can-has-lolcat.rb
91
+ - test/helper.rb