File tree 5 files changed +31
-8
lines changed 5 files changed +31
-8
lines changed Original file line number Diff line number Diff line change
1
+ --format documentation
2
+ --color
3
+ --drb
Original file line number Diff line number Diff line change
1
+
2
+ group :test do
3
+ gem 'rspec'
4
+ end
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change 1
1
$:. unshift File . expand_path ( '../../ext' , __FILE__ )
2
2
3
- require "rubygems"
4
3
require "vips"
5
- require "spec "
4
+ require "rspec "
6
5
7
6
Dir [ "#{ File . expand_path ( '../support' , __FILE__ ) } /*.rb" ] . each do |file |
8
7
require file
9
8
end
10
9
11
- Spec :: Runner . configure do |config |
10
+ RSpec . configure do |config |
12
11
config . include Spec ::Path
13
12
config . include Spec ::Helpers
14
13
28
27
# end
29
28
30
29
31
- # save this for RSpec2
30
+ # save this for RSpec2
32
31
# config.filter_run_excluding :vips_lib_version => lambda{ |ver|
33
32
# return !Spec::Helpers.match_vips_version(ver)
34
33
# }
Original file line number Diff line number Diff line change 1
1
require 'digest/sha1'
2
2
3
- Spec ::Matchers . define :match_sha1 do |sha1 |
3
+ RSpec ::Matchers . define :match_sha1 do |sha1 |
4
4
match do |image |
5
5
Digest ::SHA1 . hexdigest ( image . data ) == sha1
6
6
end
7
7
end
8
8
9
- Spec ::Matchers . define :match_image do |target |
9
+ RSpec ::Matchers . define :match_image do |target |
10
10
match do |image |
11
11
sha_ones = [ image , target ] . map do |i |
12
12
Digest ::SHA1 . hexdigest i . data
15
15
end
16
16
end
17
17
18
- Spec ::Matchers . define :approximate do |target |
18
+ RSpec ::Matchers . define :approximate do |target |
19
19
match do |approximation |
20
20
difference = ( target - approximation ) . abs
21
21
difference == 0 || ( difference / approximation ) < 0.01
22
22
end
23
23
end
24
24
25
- Spec ::Matchers . define :be_in_array do |array |
25
+ RSpec ::Matchers . define :be_in_array do |array |
26
26
match do |value |
27
27
array . include? ( value )
28
28
end
You can’t perform that action at this time.
0 commit comments