rspec 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGES +7 -0
  2. data/Rakefile.rb +2 -2
  3. data/lib/spec/expectations.rb +18 -4
  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
@@ -7,7 +7,7 @@ require 'rake/testtask'
7
7
  require 'rake/rdoctask'
8
8
 
9
9
  PKG_NAME = "rspec"
10
- PKG_VERSION = "0.1.0"
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 => [:publish_doc, :release_files]
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'])
@@ -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 ||= "<#{self}> should be <#{expected}>"
13
- should(message) { self.eql?(expected) }
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 ||= "<#{self}> should not be <#{expected}>"
18
- should(message) { not self.eql?(expected) }
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
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
3
3
  specification_version: 1
4
4
  name: rspec
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2005-08-11
6
+ version: 0.1.1
7
+ date: 2005-08-13
8
8
  summary: Behaviour Specification Framework for Ruby
9
9
  require_paths:
10
10
  - lib