merb_test_unit 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +48 -28
- data/lib/asserts/controller_asserts.rb +4 -4
- data/lib/asserts/hpricot_asserts.rb +2 -2
- metadata +8 -8
data/Rakefile
CHANGED
@@ -1,49 +1,69 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
require 'rubygems/specification'
|
2
3
|
require 'rake/gempackagetask'
|
4
|
+
require "extlib"
|
5
|
+
require 'merb-core/tasks/merb_rake_helper'
|
6
|
+
require "spec/rake/spectask"
|
3
7
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
##############################################################################
|
9
|
+
# Package && release
|
10
|
+
##############################################################################
|
11
|
+
RUBY_FORGE_PROJECT = "merb"
|
12
|
+
PROJECT_URL = "http://merbivore.com"
|
13
|
+
PROJECT_SUMMARY = "Merb plugin that provides Test::Unit support"
|
14
|
+
PROJECT_DESCRIPTION = PROJECT_SUMMARY
|
15
|
+
|
16
|
+
GEM_AUTHOR = "Yehuda Katz"
|
17
|
+
GEM_EMAIL = "ykatz@engineyard.com"
|
18
|
+
|
19
|
+
GEM_NAME = "merb_test_unit"
|
20
|
+
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
21
|
+
GEM_VERSION = (Merb::MORE_VERSION rescue "0.9.4") + PKG_BUILD
|
22
|
+
|
23
|
+
RELEASE_NAME = "REL #{GEM_VERSION}"
|
24
|
+
|
25
|
+
require "extlib/tasks/release"
|
11
26
|
|
12
27
|
spec = Gem::Specification.new do |s|
|
13
|
-
s.
|
14
|
-
s.
|
28
|
+
s.rubyforge_project = RUBY_FORGE_PROJECT
|
29
|
+
s.name = GEM_NAME
|
30
|
+
s.version = GEM_VERSION
|
15
31
|
s.platform = Gem::Platform::RUBY
|
16
32
|
s.has_rdoc = true
|
17
|
-
s.extra_rdoc_files = ["README", "LICENSE"
|
18
|
-
s.summary =
|
19
|
-
s.description =
|
20
|
-
s.author =
|
21
|
-
s.email =
|
22
|
-
s.homepage =
|
23
|
-
s.add_dependency('merb-core', '>= 0.9.
|
33
|
+
s.extra_rdoc_files = ["README", "LICENSE"]
|
34
|
+
s.summary = PROJECT_SUMMARY
|
35
|
+
s.description = PROJECT_DESCRIPTION
|
36
|
+
s.author = GEM_AUTHOR
|
37
|
+
s.email = GEM_EMAIL
|
38
|
+
s.homepage = PROJECT_URL
|
39
|
+
s.add_dependency('merb-core', '>= 0.9.4')
|
24
40
|
s.require_path = 'lib'
|
25
|
-
s.
|
26
|
-
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,test_unit_generators}/**/*")
|
41
|
+
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,test_unit_generators}/**/*")
|
27
42
|
end
|
28
43
|
|
29
|
-
windows = (PLATFORM =~ /win32|cygwin/) rescue nil
|
30
|
-
|
31
|
-
SUDO = windows ? "" : "sudo"
|
32
|
-
|
33
44
|
Rake::GemPackageTask.new(spec) do |pkg|
|
34
45
|
pkg.gem_spec = spec
|
35
46
|
end
|
36
47
|
|
37
|
-
desc "
|
48
|
+
desc "create a gemspec file"
|
49
|
+
task :make_spec do
|
50
|
+
File.open("#{NAME}.gemspec", "w") do |file|
|
51
|
+
file.puts spec.to_ruby
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
##############################################################################
|
56
|
+
# Installation
|
57
|
+
##############################################################################
|
58
|
+
|
59
|
+
desc "Install the gem"
|
38
60
|
task :install => [:package] do
|
39
|
-
sh %{#{
|
61
|
+
sh %{#{sudo} gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}
|
40
62
|
end
|
41
63
|
|
42
64
|
namespace :jruby do
|
43
|
-
|
44
|
-
desc "Run :package and install the resulting .gem with jruby"
|
65
|
+
"Run :package and install the resulting .gem with jruby"
|
45
66
|
task :install => :package do
|
46
|
-
sh %{#{
|
67
|
+
sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{GEM_NAME}-#{GEM_VERSION}.gem --no-rdoc --no-ri}
|
47
68
|
end
|
48
|
-
|
49
69
|
end
|
@@ -3,22 +3,22 @@ module Merb::Test::Unit::ControllerAsserts
|
|
3
3
|
include Merb::Test::ControllerHelper
|
4
4
|
|
5
5
|
def assert_redirect(target)
|
6
|
-
assert
|
6
|
+
assert([307, *(300..305)].include?(target.respond_to?(:status) ? target.status : target), redirect_failure_message(target))
|
7
7
|
end
|
8
8
|
|
9
9
|
def assert_redirect_to(expected, target)
|
10
10
|
location = target.headers['Location']
|
11
11
|
|
12
12
|
assert_redirect(target)
|
13
|
-
assert_equal
|
13
|
+
assert_equal(expected, location, redirect_to_failure_message(expected, location))
|
14
14
|
end
|
15
15
|
|
16
16
|
def assert_success(target)
|
17
|
-
assert
|
17
|
+
assert((200..207).include?(target.respond_to?(:status) ? target.status : target), success_failure_message(target))
|
18
18
|
end
|
19
19
|
|
20
20
|
def assert_missing(target)
|
21
|
-
assert
|
21
|
+
assert((400..417).include?(target.respond_to?(:status) ? target.status : target), missing_failure_message(target))
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -39,9 +39,9 @@ module Merb::Test::Unit::HpricotAsserts
|
|
39
39
|
end
|
40
40
|
|
41
41
|
if(equality[:count] != 0)
|
42
|
-
assert
|
42
|
+
assert(ret, "#{ message } \"#{ css_query }\" with \"#{ equality.inspect }\" was not found.")
|
43
43
|
else
|
44
|
-
assert
|
44
|
+
assert(ret, "#{ message } \"#{ css_query }\" with \"#{ equality.reject{|k,v| k == :count}.inspect }\" was found, but you specified :count => 0.")
|
45
45
|
end
|
46
46
|
ret
|
47
47
|
end
|
metadata
CHANGED
@@ -1,25 +1,26 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: merb_test_unit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Katz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-08-03 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: merb-core
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
21
|
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.9.
|
23
|
+
version: 0.9.4
|
23
24
|
version:
|
24
25
|
description: Merb plugin that provides Test::Unit support
|
25
26
|
email: ykatz@engineyard.com
|
@@ -30,7 +31,6 @@ extensions: []
|
|
30
31
|
extra_rdoc_files:
|
31
32
|
- README
|
32
33
|
- LICENSE
|
33
|
-
- TODO
|
34
34
|
files:
|
35
35
|
- LICENSE
|
36
36
|
- README
|
@@ -57,7 +57,7 @@ files:
|
|
57
57
|
- test_unit_generators/merb_resource_controller_test
|
58
58
|
- test_unit_generators/merb_resource_controller_test/merb_resource_controller_test_generator.rb
|
59
59
|
has_rdoc: true
|
60
|
-
homepage: http://
|
60
|
+
homepage: http://merbivore.com
|
61
61
|
post_install_message:
|
62
62
|
rdoc_options: []
|
63
63
|
|
@@ -77,8 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version:
|
78
78
|
requirements: []
|
79
79
|
|
80
|
-
rubyforge_project:
|
81
|
-
rubygems_version: 1.0
|
80
|
+
rubyforge_project: merb
|
81
|
+
rubygems_version: 1.2.0
|
82
82
|
signing_key:
|
83
83
|
specification_version: 2
|
84
84
|
summary: Merb plugin that provides Test::Unit support
|