Skip to content

Commit e1b240e

Browse files
committed
adds Gemfile and moves towards RSpec2
1 parent f864c6d commit e1b240e

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--drb

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
group :test do
3+
gem 'rspec'
4+
end

Gemfile.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
GEM
2+
specs:
3+
diff-lcs (1.1.3)
4+
rspec (2.10.0)
5+
rspec-core (~> 2.10.0)
6+
rspec-expectations (~> 2.10.0)
7+
rspec-mocks (~> 2.10.0)
8+
rspec-core (2.10.1)
9+
rspec-expectations (2.10.0)
10+
diff-lcs (~> 1.1.3)
11+
rspec-mocks (2.10.1)
12+
13+
PLATFORMS
14+
ruby
15+
16+
DEPENDENCIES
17+
rspec

spec/spec_helper.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
$:.unshift File.expand_path('../../ext', __FILE__)
22

3-
require "rubygems"
43
require "vips"
5-
require "spec"
4+
require "rspec"
65

76
Dir["#{File.expand_path('../support', __FILE__)}/*.rb"].each do |file|
87
require file
98
end
109

11-
Spec::Runner.configure do |config|
10+
RSpec.configure do |config|
1211
config.include Spec::Path
1312
config.include Spec::Helpers
1413

@@ -28,7 +27,7 @@
2827
# end
2928

3029

31-
# save this for RSpec2
30+
# save this for RSpec2
3231
# config.filter_run_excluding :vips_lib_version => lambda{ |ver|
3332
# return !Spec::Helpers.match_vips_version(ver)
3433
# }

spec/support/matchers.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
require 'digest/sha1'
22

3-
Spec::Matchers.define :match_sha1 do |sha1|
3+
RSpec::Matchers.define :match_sha1 do |sha1|
44
match do |image|
55
Digest::SHA1.hexdigest(image.data) == sha1
66
end
77
end
88

9-
Spec::Matchers.define :match_image do |target|
9+
RSpec::Matchers.define :match_image do |target|
1010
match do |image|
1111
sha_ones = [image, target].map do |i|
1212
Digest::SHA1.hexdigest i.data
@@ -15,14 +15,14 @@
1515
end
1616
end
1717

18-
Spec::Matchers.define :approximate do |target|
18+
RSpec::Matchers.define :approximate do |target|
1919
match do |approximation|
2020
difference = (target - approximation).abs
2121
difference == 0 || (difference / approximation) < 0.01
2222
end
2323
end
2424

25-
Spec::Matchers.define :be_in_array do |array|
25+
RSpec::Matchers.define :be_in_array do |array|
2626
match do |value|
2727
array.include?(value)
2828
end

0 commit comments

Comments
 (0)