rspec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -0
- data/Rakefile.rb +2 -2
- data/lib/spec/expectations.rb +18 -4
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
= RSpec Changelog
|
2
2
|
|
3
|
+
== Version 0.1.1
|
4
|
+
|
5
|
+
This release adds some shoulds and improves error reporting
|
6
|
+
|
7
|
+
* Added should_be_same_as and should_not_be_same_as
|
8
|
+
* Improved error reporting for comparison expectations
|
9
|
+
|
3
10
|
== Version 0.1.0
|
4
11
|
|
5
12
|
This is the first preview release of RSpec, a Behaviour-Driven Development library for Ruby
|
data/Rakefile.rb
CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
|
|
7
7
|
require 'rake/rdoctask'
|
8
8
|
|
9
9
|
PKG_NAME = "rspec"
|
10
|
-
PKG_VERSION = "0.1.
|
10
|
+
PKG_VERSION = "0.1.1"
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
PKG_FILES = FileList[
|
13
13
|
'[A-Z]*',
|
@@ -99,7 +99,7 @@ task :todo do
|
|
99
99
|
egrep /#.*(FIXME|TODO|TBD)/
|
100
100
|
end
|
101
101
|
|
102
|
-
task :release => [:
|
102
|
+
task :release => [:release_files, :publish_doc]
|
103
103
|
|
104
104
|
task :publish_doc => [:rdoc] do
|
105
105
|
publisher = Rake::RubyForgePublisher.new(PKG_NAME, ENV['RUBYFORGE_USER'])
|
data/lib/spec/expectations.rb
CHANGED
@@ -7,15 +7,29 @@ module Spec
|
|
7
7
|
raise Spec::Exceptions::ExpectationNotMetError.new(message)
|
8
8
|
end
|
9
9
|
end
|
10
|
+
|
11
|
+
def default_message(expectation, expected)
|
12
|
+
"<#{self}>\n#{expectation}:\n<#{expected}>"
|
13
|
+
end
|
10
14
|
|
11
15
|
def should_equal(expected, message=nil)
|
12
|
-
message ||= "
|
13
|
-
should(message) { self
|
16
|
+
message ||= default_message("should be equal to", expected)
|
17
|
+
should(message) { self == expected }
|
14
18
|
end
|
15
19
|
|
16
20
|
def should_not_equal(expected, message=nil)
|
17
|
-
message ||= "
|
18
|
-
should(message) { not self
|
21
|
+
message ||= default_message("should not be equal to", expected)
|
22
|
+
should(message) { not self == expected }
|
23
|
+
end
|
24
|
+
|
25
|
+
def should_be_same_as(expected, message=nil)
|
26
|
+
message ||= default_message("should be same as", expected)
|
27
|
+
should(message) { self.equal?(expected) }
|
28
|
+
end
|
29
|
+
|
30
|
+
def should_not_be_same_as(expected, message=nil)
|
31
|
+
message ||= default_message("should not be same as", expected)
|
32
|
+
should(message) { not self.equal?(expected) }
|
19
33
|
end
|
20
34
|
|
21
35
|
def should_be_nil(message=nil)
|
metadata
CHANGED