kosmeek_test_tools 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README ADDED
@@ -0,0 +1,13 @@
1
+ Kosmeek-tools
2
+ =============
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+
13
+ Copyright (c) 2010 [name of plugin creator], released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,45 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+ require 'rubygems'
5
+ require 'rake/gempackagetask'
6
+
7
+ desc 'Default: run unit tests.'
8
+ task :default => :test
9
+
10
+ desc 'Test the kosmeek_tools plugin.'
11
+ Rake::TestTask.new(:test) do |t|
12
+ t.libs << 'lib'
13
+ t.libs << 'test'
14
+ t.pattern = 'test/**/*_test.rb'
15
+ t.verbose = true
16
+ end
17
+
18
+ desc 'Generate documentation for the kosmeek_tools plugin.'
19
+ Rake::RDocTask.new(:rdoc) do |rdoc|
20
+ rdoc.rdoc_dir = 'rdoc'
21
+ rdoc.title = 'Kosmeek Test Tools'
22
+ rdoc.options << '--line-numbers' << '--inline-source'
23
+ rdoc.rdoc_files.include('README')
24
+ rdoc.rdoc_files.include('lib/**/*.rb')
25
+ end
26
+ PKG_FILES = FileList[
27
+ '[a-zA-Z]*', 'lib/**/*', 'rails/**/*', 'tasks/**/*', 'test/**/*'
28
+ ]
29
+ spec = Gem::Specification.new do |s|
30
+ s.name = "kosmeek_test_tools"
31
+ s.version = "0.0.1"
32
+ s.author = "Robert Dober"
33
+ s.email = "robert.dober@gmail.com"
34
+ s.homepage = "http://kosmopolead.com"
35
+ s.platform = Gem::Platform::RUBY
36
+ s.summary = "Sharing Tests among platforms"
37
+ s.files = PKG_FILES.to_a
38
+ s.require_path = "lib"
39
+ s.has_rdoc = false
40
+ s.extra_rdoc_files = ["README"]
41
+ end
42
+ desc 'Turn this plugin into a gem.'
43
+ Rake::GemPackageTask.new(spec) do |pkg|
44
+ pkg.gem_spec = spec
45
+ end
data/install.rb ADDED
@@ -0,0 +1 @@
1
+ # Install hook code here
@@ -0,0 +1,62 @@
1
+ class ::ActionController::TestCase
2
+
3
+ def assert_class_tag tag, klass, atts={}, &blk
4
+ atts[ :attributes ] = atts.fetch( :attributes, {} ).merge( :class => klass )
5
+ assert_tag( tag, atts, &blk )
6
+ end
7
+
8
+ def assert_content content
9
+ assert_tag :content => trans( content )
10
+ end
11
+
12
+ def assert_no_content content
13
+ assert_no_tag :content => trans( content )
14
+ end
15
+
16
+ def assert_input text, options={}
17
+ assert_tag :input, :attributes => {:value => text}.merge( options )
18
+ end
19
+
20
+ def assert_link_to path, atts={}, &blk
21
+ assert_tag( :a, :atts.merge( :attributes => { :href => path} ), &blk )
22
+ end
23
+
24
+ def assert_link_with content, atts={}, &blk
25
+ assert_tag( :a, atts.merge( :content => content ), &blk )
26
+ end
27
+
28
+ def assert_text txt
29
+ assert_tag :content => txt
30
+ end
31
+
32
+ def assert_no_text txt
33
+ assert_no_tag :content => txt
34
+ end
35
+
36
+ # If key starts with an . it is translated directly via I18n#t.
37
+ # Otherwise the controller name and the controllor action, each
38
+ # suffixed with the necessary . are prepended to the key before
39
+ # calling I18n
40
+ def trans key
41
+ return I18n.t( key ) if /\A\./===key.to_s
42
+ I18n.t "#{@controller.params[ :controller ]}.#{@controller.params[ :action ]}.#{key}"
43
+ end
44
+
45
+ end
46
+
47
+ module ::Shoulda
48
+ module ActionController
49
+ module Macros
50
+ def should_render_content content
51
+ should "render #{content}" do
52
+ assert_tag :content => content
53
+ end
54
+ end
55
+ def should_not_render_content content
56
+ should "not render #{content}" do
57
+ assert_no_tag :content => content
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,8 @@
1
+ # Kosmeek-tools
2
+
3
+ require 'kosmeek/functional_test_helpers'
4
+
5
+ module KosmeekTestTools
6
+ def kosmeek_test_tools_loaded?; true end
7
+ extend self
8
+ end
data/rails/init.rb ADDED
@@ -0,0 +1,3 @@
1
+ # Include hook code here
2
+ require 'kosmeek_tools'
3
+
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :kosmeek_tools do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class KosmeekToolsTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'active_support'
3
+ require 'active_support/test_case'
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kosmeek_test_tools
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Robert Dober
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-02-11 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email: robert.dober@gmail.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ files:
25
+ - README
26
+ - MIT-LICENSE
27
+ - install.rb
28
+ - Rakefile
29
+ - uninstall.rb
30
+ - lib/kosmeek/functional_test_helpers.rb
31
+ - lib/kosmeek_test_tools.rb
32
+ - rails/init.rb
33
+ - tasks/kosmeek_tools_tasks.rake
34
+ - test/test_helper.rb
35
+ - test/kosmeek_tools_test.rb
36
+ has_rdoc: true
37
+ homepage: http://kosmopolead.com
38
+ licenses: []
39
+
40
+ post_install_message:
41
+ rdoc_options: []
42
+
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: "0"
50
+ version:
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: "0"
56
+ version:
57
+ requirements: []
58
+
59
+ rubyforge_project:
60
+ rubygems_version: 1.3.5
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: Sharing Tests among platforms
64
+ test_files: []
65
+