rspec 0.1.2 → 0.1.3

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 +19 -0
  2. data/Rakefile.rb +27 -7
  3. data/lib/spec/mock.rb +5 -1
  4. metadata +3 -3
data/CHANGES CHANGED
@@ -1,5 +1,24 @@
1
1
  = RSpec Changelog
2
2
 
3
+ == Explanation of this file:
4
+
5
+ * This document should be updated for every commit.
6
+
7
+ * The first section of each version (until the lines starting with a *)
8
+ will be used in the release notes' summary as well
9
+ as in the news posted on rubyforge. Therefore,
10
+ make sure it is a sentence that makes sense to the reader.
11
+ It should summarise the release at a high level.
12
+
13
+ * Make sure the PKG_VERSION constant in Rakefile.rb is
14
+ consistent with the latest version in this document.
15
+
16
+ == Version 0.1.3
17
+
18
+ Improved mocking:
19
+
20
+ * block based Mock expectations
21
+
3
22
  == Version 0.1.2
4
23
 
5
24
  This release adds some improvements to the mock API and minor syntax improvements
@@ -1,7 +1,9 @@
1
1
  $:.unshift('lib')
2
+ require 'rubygems'
2
3
  require 'xforge'
3
4
  require 'rake/gempackagetask'
4
5
  require 'rake/contrib/rubyforgepublisher'
6
+ require 'rake/contrib/xforge'
5
7
  require 'rake/clean'
6
8
  require 'rake/testtask'
7
9
  require 'rake/rdoctask'
@@ -17,7 +19,7 @@ PKG_NAME = "rspec"
17
19
  # (This is subject to change - AH)
18
20
  #
19
21
  # REMEMBER TO KEEP PKG_VERSION IN SYNC WITH CHANGELOG
20
- PKG_VERSION = "0.1.2"
22
+ PKG_VERSION = "0.1.3"
21
23
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
22
24
  PKG_FILES = FileList[
23
25
  '[A-Z]*',
@@ -25,7 +27,7 @@ PKG_FILES = FileList[
25
27
  'doc/**/*'
26
28
  ]
27
29
 
28
- task :default => [:gem]
30
+ task :default => [:test]
29
31
 
30
32
  Rake::TestTask.new do |t|
31
33
  t.libs << "test"
@@ -109,7 +111,12 @@ task :todo do
109
111
  egrep /#.*(FIXME|TODO|TBD)/
110
112
  end
111
113
 
112
- task :release => [:release_files, :publish_doc]
114
+ task :release => [:verify_env_vars, :release_files, :publish_doc, :publish_news]
115
+
116
+ task :verify_env_vars do
117
+ raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
118
+ raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
119
+ end
113
120
 
114
121
  task :publish_doc => [:rdoc] do
115
122
  publisher = Rake::RubyForgePublisher.new(PKG_NAME, ENV['RUBYFORGE_USER'])
@@ -123,10 +130,23 @@ task :release_files => [:gem] do
123
130
  ]
124
131
 
125
132
  Rake::XForge::Release.new(PKG_NAME) do |xf|
126
- # Never hardcode user name and password in the Rakefile!
127
- xf.user_name = ENV['RUBYFORGE_USER']
133
+ # Never hardcode user name and password in the Rakefile!
134
+ xf.user_name = ENV['RUBYFORGE_USER']
128
135
  xf.password = ENV['RUBYFORGE_PASSWORD']
129
136
  xf.files = release_files.to_a
130
- xf.release_name = "RSpec #{PKG_VERSION}"
131
- end
137
+ xf.release_name = "RSpec #{PKG_VERSION}"
138
+ end
139
+ end
140
+
141
+ desc "Publish news on RubyForge"
142
+ task :publish_news => [:gem] do
143
+ release_files = FileList[
144
+ "pkg/#{PKG_FILE_NAME}.gem"
145
+ ]
146
+
147
+ Rake::XForge::NewsPublisher.new(PKG_NAME) do |news|
148
+ # Never hardcode user name and password in the Rakefile!
149
+ news.user_name = ENV['RUBYFORGE_USER']
150
+ news.password = ENV['RUBYFORGE_PASSWORD']
151
+ end
132
152
  end
@@ -54,7 +54,11 @@ class MockExpectation
54
54
 
55
55
  def verify_call(message,args,block)
56
56
  unless @method_block.nil?
57
- result = @method_block.call(*args)
57
+ begin
58
+ result = @method_block.call(*args)
59
+ rescue Spec::Exceptions::ExpectationNotMetError => detail
60
+ raise Spec::Exceptions::MockExpectationError, "Call expectation violated with: " + $!
61
+ end
58
62
  @call_count = @call_count + 1
59
63
  return result
60
64
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.8
2
+ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: rspec
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.2
7
- date: 2005-08-13
6
+ version: 0.1.3
7
+ date: 2005-08-14
8
8
  summary: Behaviour Specification Framework for Ruby
9
9
  require_paths:
10
10
  - lib