gosu_enhanced 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
data/spec/size_spec.rb CHANGED
@@ -3,148 +3,148 @@ require 'spec_helper'
3
3
  describe GosuEnhanced::Size do
4
4
  describe '#initialize' do
5
5
  it 'should work with two values' do
6
- size = GosuEnhanced::Size.new( 10, 20 )
7
- expect( size.width ).to eq 10
8
- expect( size.height ).to eq 20
6
+ size = GosuEnhanced::Size.new(10, 20)
7
+ expect(size.width).to eq 10
8
+ expect(size.height).to eq 20
9
9
  end
10
10
 
11
11
  it 'should reject negative values' do
12
- expect { GosuEnhanced::Size.new( -10, 20 ) }.to raise_error Exception
13
- expect { GosuEnhanced::Size.new( 10, -20 ) }.to raise_error Exception
14
- expect { GosuEnhanced::Size.new( -10, -20 ) }.to raise_error Exception
12
+ expect { GosuEnhanced::Size.new(-10, 20) }.to raise_error Exception
13
+ expect { GosuEnhanced::Size.new(10, -20) }.to raise_error Exception
14
+ expect { GosuEnhanced::Size.new(-10, -20) }.to raise_error Exception
15
15
  end
16
16
  end
17
17
 
18
18
  describe '#inflate' do
19
19
  it 'should work with another Size' do
20
- size = GosuEnhanced::Size.new( 10, 20 )
21
- esize = size.inflate( GosuEnhanced::Size.new( 30, 40 ) )
22
- expect( esize.width ).to eq 40
23
- expect( esize.height ).to eq 60
20
+ size = GosuEnhanced::Size.new(10, 20)
21
+ esize = size.inflate(GosuEnhanced::Size.new(30, 40))
22
+ expect(esize.width).to eq 40
23
+ expect(esize.height).to eq 60
24
24
  end
25
25
 
26
26
  it 'should work with two values' do
27
- size = GosuEnhanced::Size.new( 10, 20 )
28
- esize = size.inflate( 40, 50 )
29
- expect( esize.width ).to eq 50
30
- expect( esize.height ).to eq 70
27
+ size = GosuEnhanced::Size.new(10, 20)
28
+ esize = size.inflate(40, 50)
29
+ expect(esize.width).to eq 50
30
+ expect(esize.height).to eq 70
31
31
  end
32
32
 
33
33
  it 'should work with negative values' do
34
- size = GosuEnhanced::Size.new( 40, 50 )
35
- esize = size.inflate( -30, -20 )
36
- expect( esize.width ).to eq 10
37
- expect( esize.height ).to eq 30
34
+ size = GosuEnhanced::Size.new(40, 50)
35
+ esize = size.inflate(-30, -20)
36
+ expect(esize.width).to eq 10
37
+ expect(esize.height).to eq 30
38
38
  end
39
39
 
40
40
  it 'should raise an error with out-of-range values' do
41
- size = GosuEnhanced::Size.new( 40, 50 )
42
- expect { size.inflate( -50, -20 ) }.to raise_error Exception
43
- expect { size.inflate( -30, -60 ) }.to raise_error Exception
44
- expect { size.inflate( -50, -70 ) }.to raise_error Exception
41
+ size = GosuEnhanced::Size.new(40, 50)
42
+ expect { size.inflate(-50, -20) }.to raise_error Exception
43
+ expect { size.inflate(-30, -60) }.to raise_error Exception
44
+ expect { size.inflate(-50, -70) }.to raise_error Exception
45
45
  end
46
46
  end
47
47
 
48
48
  describe '#deflate' do
49
49
  it 'should work with another Size' do
50
- size = GosuEnhanced::Size.new( 60, 80 )
51
- esize = size.deflate( GosuEnhanced::Size.new( 30, 40 ) )
52
- expect( esize.width ).to eq 30
53
- expect( esize.height ).to eq 40
50
+ size = GosuEnhanced::Size.new(60, 80)
51
+ esize = size.deflate(GosuEnhanced::Size.new(30, 40))
52
+ expect(esize.width).to eq 30
53
+ expect(esize.height).to eq 40
54
54
  end
55
55
 
56
56
  it 'should work with two values' do
57
- size = GosuEnhanced::Size.new( 70, 60 )
58
- esize = size.deflate( 40, 50 )
59
- expect( esize.width ).to eq 30
60
- expect( esize.height ).to eq 10
57
+ size = GosuEnhanced::Size.new(70, 60)
58
+ esize = size.deflate(40, 50)
59
+ expect(esize.width).to eq 30
60
+ expect(esize.height).to eq 10
61
61
  end
62
62
 
63
63
  it 'should raise an error for out-of-range values' do
64
- size = GosuEnhanced::Size.new( 70, 60 )
65
- expect { size.deflate( 80, 50 ) }.to raise_error Exception
66
- expect { size.deflate( 60, 70 ) }.to raise_error Exception
67
- expect { size.deflate( 80, 70 ) }.to raise_error Exception
64
+ size = GosuEnhanced::Size.new(70, 60)
65
+ expect { size.deflate(80, 50) }.to raise_error Exception
66
+ expect { size.deflate(60, 70) }.to raise_error Exception
67
+ expect { size.deflate(80, 70) }.to raise_error Exception
68
68
  end
69
69
  end
70
70
 
71
71
  describe '#inflate!' do
72
72
  it 'should work with another Size' do
73
- size = GosuEnhanced::Size.new( 10, 20 )
74
- size.inflate!( GosuEnhanced::Size.new( 30, 40 ) )
75
- expect( size.width ).to eq 40
76
- expect( size.height ).to eq 60
73
+ size = GosuEnhanced::Size.new(10, 20)
74
+ size.inflate!(GosuEnhanced::Size.new(30, 40))
75
+ expect(size.width).to eq 40
76
+ expect(size.height).to eq 60
77
77
  end
78
78
 
79
79
  it 'should work with two values' do
80
- size = GosuEnhanced::Size.new( 10, 20 )
81
- size.inflate!( 40, 50 )
82
- expect( size.width ).to eq 50
83
- expect( size.height ).to eq 70
80
+ size = GosuEnhanced::Size.new(10, 20)
81
+ size.inflate!(40, 50)
82
+ expect(size.width).to eq 50
83
+ expect(size.height).to eq 70
84
84
  end
85
85
 
86
86
  it 'should work with negative values' do
87
- size = GosuEnhanced::Size.new( 40, 50 )
88
- size.inflate!( -30, -20 )
89
- expect( size.width ).to eq 10
90
- expect( size.height ).to eq 30
87
+ size = GosuEnhanced::Size.new(40, 50)
88
+ size.inflate!(-30, -20)
89
+ expect(size.width).to eq 10
90
+ expect(size.height).to eq 30
91
91
  end
92
92
 
93
93
  it 'should raise an error with out-of-range values' do
94
- size = GosuEnhanced::Size.new( 40, 50 )
95
- expect { size.inflate!( -50, -20 ) }.to raise_error Exception
96
- expect { size.inflate!( -30, -60 ) }.to raise_error Exception
97
- expect { size.inflate!( -50, -70 ) }.to raise_error Exception
94
+ size = GosuEnhanced::Size.new(40, 50)
95
+ expect { size.inflate!(-50, -20) }.to raise_error Exception
96
+ expect { size.inflate!(-30, -60) }.to raise_error Exception
97
+ expect { size.inflate!(-50, -70) }.to raise_error Exception
98
98
  end
99
99
  end
100
100
 
101
101
  describe '#deflate!' do
102
102
  it 'should work with another Size' do
103
- size = GosuEnhanced::Size.new( 60, 80 )
104
- size.deflate!( GosuEnhanced::Size.new( 30, 40 ) )
105
- expect( size.width ).to eq 30
106
- expect( size.height ).to eq 40
103
+ size = GosuEnhanced::Size.new(60, 80)
104
+ size.deflate!(GosuEnhanced::Size.new(30, 40))
105
+ expect(size.width).to eq 30
106
+ expect(size.height).to eq 40
107
107
  end
108
108
 
109
109
  it 'should work with two values' do
110
- size = GosuEnhanced::Size.new( 70, 60 )
111
- size.deflate!( 40, 50 )
112
- expect( size.width ).to eq 30
113
- expect( size.height ).to eq 10
110
+ size = GosuEnhanced::Size.new(70, 60)
111
+ size.deflate!(40, 50)
112
+ expect(size.width).to eq 30
113
+ expect(size.height).to eq 10
114
114
  end
115
115
 
116
116
  it 'should raise an error for out-of-range values' do
117
- size = GosuEnhanced::Size.new( 70, 60 )
118
- expect { size.deflate!( 80, 50 ) }.to raise_error Exception
119
- expect { size.deflate!( 60, 70 ) }.to raise_error Exception
120
- expect { size.deflate!( 80, 70 ) }.to raise_error Exception
117
+ size = GosuEnhanced::Size.new(70, 60)
118
+ expect { size.deflate!(80, 50) }.to raise_error Exception
119
+ expect { size.deflate!(60, 70) }.to raise_error Exception
120
+ expect { size.deflate!(80, 70) }.to raise_error Exception
121
121
  end
122
122
  end
123
123
 
124
124
  describe '#dup' do
125
125
  it 'should make a copy of the Size' do
126
- size = GosuEnhanced::Size.new( 10, 20 )
126
+ size = GosuEnhanced::Size.new(10, 20)
127
127
  nsize = size.dup
128
128
 
129
- expect( size.width ).to eq 10
130
- expect( size.height ).to eq 20
129
+ expect(size.width).to eq 10
130
+ expect(size.height).to eq 20
131
131
 
132
- expect( nsize.width ).to eq 10
133
- expect( nsize.height ).to eq 20
132
+ expect(nsize.width).to eq 10
133
+ expect(nsize.height).to eq 20
134
134
 
135
- nsize.inflate!( 40, 50 )
136
- expect( nsize.width ).to eq 50
137
- expect( nsize.height ).to eq 70
135
+ nsize.inflate!(40, 50)
136
+ expect(nsize.width).to eq 50
137
+ expect(nsize.height).to eq 70
138
138
 
139
- expect( size.width ).to eq 10
140
- expect( size.height ).to eq 20
139
+ expect(size.width).to eq 10
140
+ expect(size.height).to eq 20
141
141
  end
142
142
  end
143
-
143
+
144
144
  describe '#to_s' do
145
145
  it 'should render usefully' do
146
- size = GosuEnhanced::Size.new( 10, 20 )
147
- expect( size.to_s ).to eq '<GosuEnhanced::Size 10x20>'
146
+ size = GosuEnhanced::Size.new(10, 20)
147
+ expect(size.to_s).to eq '<GosuEnhanced::Size 10x20>'
148
148
  end
149
149
  end
150
150
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gosu_enhanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Nicholls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gosu
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.9'
19
+ version: '0.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.9'
26
+ version: '0.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '1.10'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.6'
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.9'
47
+ version: '10.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.9'
54
+ version: '10.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.0'
75
+ version: '0.2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.0'
82
+ version: '0.2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement