renvy 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/renvy.rb +14 -9
- data/lib/renvy/version.rb +5 -0
- data/renvy.gemspec +15 -0
- data/test/contest_test.rb +12 -0
- data/test/include_test.rb +13 -0
- metadata +34 -7
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/lib/renvy.rb
CHANGED
@@ -23,11 +23,7 @@ require 'test/unit'
|
|
23
23
|
# should_not.raise { puts "hi" }
|
24
24
|
#
|
25
25
|
module REnvy
|
26
|
-
|
27
|
-
|
28
|
-
def self.version
|
29
|
-
VERSION
|
30
|
-
end
|
26
|
+
require File.expand_path('../renvy/version', __FILE__)
|
31
27
|
|
32
28
|
class Should
|
33
29
|
attr_reader :left
|
@@ -66,7 +62,7 @@ module REnvy
|
|
66
62
|
def <(right) assert_or_refute :operator, left, :<, right; end
|
67
63
|
def >=(right) assert_or_refute :operator, left, :>=, right; end
|
68
64
|
def <=(right) assert_or_refute :operator, left, :<=, right; end
|
69
|
-
def include(right) assert_or_refute :
|
65
|
+
def include(right) assert_or_refute :includes, left, right; end
|
70
66
|
def instance_of(right) assert_or_refute :instance_of, right, left; end
|
71
67
|
def kind_of(right) assert_or_refute :kind_of, right, left; end
|
72
68
|
def nil() assert_or_refute :nil, left; end
|
@@ -128,9 +124,18 @@ class Object
|
|
128
124
|
end
|
129
125
|
|
130
126
|
class Test::Unit::TestCase
|
131
|
-
alias
|
132
|
-
def
|
133
|
-
old_setup &blk
|
127
|
+
alias run_before_renvy run
|
128
|
+
def run(*a, &blk)
|
134
129
|
REnvy::Should.init self
|
130
|
+
run_before_renvy *a, &blk
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# Workaround for assert_includes missing in old versions
|
135
|
+
unless Test::Unit::TestCase.instance_methods.include?(:assert_includes)
|
136
|
+
Test::Unit::TestCase.class_eval do
|
137
|
+
def assert_includes(haystack, needle, message=nil)
|
138
|
+
assert(haystack.include?(needle)) { message || "Expected '#{haystack}' to include '#{needle}'" }
|
139
|
+
end
|
135
140
|
end
|
136
141
|
end
|
data/renvy.gemspec
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require "./lib/renvy/version"
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.name = "renvy"
|
4
|
+
s.version = REnvy.version
|
5
|
+
s.summary = "RSpec-like syntax for Test::Unit."
|
6
|
+
s.description = "REnvy lets you use a syntax similar to RSpec on your Test::Unit tests."
|
7
|
+
s.authors = ["Rico Sta. Cruz"]
|
8
|
+
s.email = ["rico@sinefunc.com"]
|
9
|
+
s.homepage = "http://github.com/rstacruz/renvy"
|
10
|
+
s.files = `git ls-files`.strip.split("\n")
|
11
|
+
|
12
|
+
s.add_dependency "test-unit"
|
13
|
+
s.add_development_dependency "contest"
|
14
|
+
s.add_development_dependency "mocha"
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path('../../lib/renvy', __FILE__)
|
2
|
+
require 'mocha'
|
3
|
+
|
4
|
+
class IncludeTest < Test::Unit::TestCase
|
5
|
+
def test_should_include
|
6
|
+
"abc".should.include "b"
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_should_include_fail
|
10
|
+
self.expects(:assert).with { |a, b| a == false && b.call =~ /Expected/ }
|
11
|
+
"axxc".should.include "b"
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renvy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-08-31 00:00:00.000000000 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: test-unit
|
17
|
-
requirement: &
|
17
|
+
requirement: &2165444260 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,29 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2165444260
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: contest
|
28
|
+
requirement: &2165443840 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *2165443840
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: mocha
|
39
|
+
requirement: &2165443420 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *2165443420
|
26
48
|
description: REnvy lets you use a syntax similar to RSpec on your Test::Unit tests.
|
27
49
|
email:
|
28
50
|
- rico@sinefunc.com
|
@@ -30,12 +52,17 @@ executables: []
|
|
30
52
|
extensions: []
|
31
53
|
extra_rdoc_files: []
|
32
54
|
files:
|
33
|
-
-
|
34
|
-
- test/extension_test.rb
|
35
|
-
- test/renvy_test.rb
|
55
|
+
- .gitignore
|
36
56
|
- HISTORY.md
|
37
57
|
- README.md
|
38
58
|
- Rakefile
|
59
|
+
- lib/renvy.rb
|
60
|
+
- lib/renvy/version.rb
|
61
|
+
- renvy.gemspec
|
62
|
+
- test/contest_test.rb
|
63
|
+
- test/extension_test.rb
|
64
|
+
- test/include_test.rb
|
65
|
+
- test/renvy_test.rb
|
39
66
|
has_rdoc: true
|
40
67
|
homepage: http://github.com/rstacruz/renvy
|
41
68
|
licenses: []
|