rspec 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +10 -0
- data/Rakefile.rb +4 -4
- data/lib/spec/expectations.rb +10 -0
- data/test/expectations_test.rb +28 -0
- metadata +2 -2
data/CHANGES
CHANGED
@@ -13,6 +13,16 @@
|
|
13
13
|
* Make sure the PKG_VERSION constant in Rakefile.rb is
|
14
14
|
consistent with the latest version in this document.
|
15
15
|
|
16
|
+
* IMPORTANT! A bug in XForge requires at least one * (change) to be present
|
17
|
+
for each release, or it will include the release notes for the previous
|
18
|
+
version!!
|
19
|
+
|
20
|
+
== Version 0.1.6
|
21
|
+
|
22
|
+
More should methods.
|
23
|
+
|
24
|
+
* Added should_match and should_not_match
|
25
|
+
|
16
26
|
== Version 0.1.5
|
17
27
|
|
18
28
|
Included examples and tests in gem.
|
data/Rakefile.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
$:.unshift('lib')
|
2
2
|
require 'rubygems'
|
3
|
-
require '
|
3
|
+
require 'meta_project'
|
4
4
|
require 'rake/gempackagetask'
|
5
5
|
require 'rake/contrib/rubyforgepublisher'
|
6
6
|
require 'rake/contrib/xforge'
|
@@ -19,7 +19,7 @@ PKG_NAME = "rspec"
|
|
19
19
|
# (This is subject to change - AH)
|
20
20
|
#
|
21
21
|
# REMEMBER TO KEEP PKG_VERSION IN SYNC WITH CHANGELOG
|
22
|
-
PKG_VERSION = "0.1.
|
22
|
+
PKG_VERSION = "0.1.6"
|
23
23
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
24
24
|
PKG_FILES = FileList[
|
25
25
|
'[A-Z]*',
|
@@ -133,7 +133,7 @@ task :release_files => [:gem] do
|
|
133
133
|
"pkg/#{PKG_FILE_NAME}.gem"
|
134
134
|
]
|
135
135
|
|
136
|
-
Rake::XForge::Release.new(PKG_NAME) do |xf|
|
136
|
+
Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |xf|
|
137
137
|
# Never hardcode user name and password in the Rakefile!
|
138
138
|
xf.user_name = ENV['RUBYFORGE_USER']
|
139
139
|
xf.password = ENV['RUBYFORGE_PASSWORD']
|
@@ -148,7 +148,7 @@ task :publish_news => [:gem] do
|
|
148
148
|
"pkg/#{PKG_FILE_NAME}.gem"
|
149
149
|
]
|
150
150
|
|
151
|
-
Rake::XForge::NewsPublisher.new(PKG_NAME) do |news|
|
151
|
+
Rake::XForge::NewsPublisher.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |news|
|
152
152
|
# Never hardcode user name and password in the Rakefile!
|
153
153
|
news.user_name = ENV['RUBYFORGE_USER']
|
154
154
|
news.password = ENV['RUBYFORGE_PASSWORD']
|
data/lib/spec/expectations.rb
CHANGED
@@ -32,6 +32,16 @@ module Spec
|
|
32
32
|
should(message) { not self.equal?(expected) }
|
33
33
|
end
|
34
34
|
|
35
|
+
def should_match(expected, message=nil)
|
36
|
+
message ||= default_message("should match", expected)
|
37
|
+
should(message) { self =~ expected }
|
38
|
+
end
|
39
|
+
|
40
|
+
def should_not_match(expected, message=nil)
|
41
|
+
message ||= default_message("should not match", expected)
|
42
|
+
should(message) { not self =~ expected }
|
43
|
+
end
|
44
|
+
|
35
45
|
def should_be_nil(message=nil)
|
36
46
|
message ||= "<#{self}> should be nil"
|
37
47
|
should(message) { self.nil? }
|
data/test/expectations_test.rb
CHANGED
@@ -95,6 +95,34 @@ class ExpectationsTest < Test::Unit::TestCase
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
+
# should_match
|
99
|
+
|
100
|
+
def test_should_match_should_not_raise_when_objects_match
|
101
|
+
assert_nothing_raised do
|
102
|
+
"hi aslak".should_match /aslak/
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_should_equal_should_raise_when_objects_do_not_match
|
107
|
+
assert_raise(Spec::Exceptions::ExpectationNotMetError) do
|
108
|
+
"hi aslak".should_match /steve/
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# should_not_match
|
113
|
+
|
114
|
+
def test_should_not_match_should_not_raise_when_objects_do_not_match
|
115
|
+
assert_nothing_raised do
|
116
|
+
"hi aslak".should_not_match /steve/
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_should_not_match_should_raise_when_objects_match
|
121
|
+
assert_raise(Spec::Exceptions::ExpectationNotMetError) do
|
122
|
+
"hi aslak".should_not_match /aslak/
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
98
126
|
# should_be_nil
|
99
127
|
|
100
128
|
def test_should_be_nil_should_not_raise_when_object_is_nil
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rspec
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date: 2005-08-
|
6
|
+
version: 0.1.6
|
7
|
+
date: 2005-08-22 00:00:00 -04:00
|
8
8
|
summary: Behaviour Specification Framework for Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|