frill 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/frill/frill.rb +2 -1
  3. data/spec/frill_spec.rb +25 -11
  4. metadata +21 -10
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -26,7 +26,7 @@ module Frill
26
26
  end
27
27
 
28
28
  def after decorator
29
- decorator.before self
29
+ move(Frill.decorators.index(decorator) + 1)
30
30
  end
31
31
 
32
32
  def first
@@ -37,6 +37,7 @@ module Frill
37
37
  def move index
38
38
  Frill.decorators.delete self
39
39
  Frill.decorators.insert index, self
40
+ Frill.decorators.compact!
40
41
  end
41
42
  end
42
43
  end
@@ -61,33 +61,47 @@ describe Frill do
61
61
  end
62
62
 
63
63
  describe Frill::ClassMethods do
64
- let(:module1) { Module.new { include Frill } }
65
- let(:module2) { Module.new { include Frill } }
64
+ before do
65
+ module Module1
66
+ include Frill
67
+ end
68
+
69
+ module Module2
70
+ include Frill
71
+ end
72
+
73
+ module Module3
74
+ include Frill
75
+ end
76
+ end
66
77
 
67
78
  describe ".before" do
68
79
  it "inserts the current module before the requested module in Frill's list of decorators" do
69
- Frill.decorators.should == [module1, module2]
80
+ Frill.decorators.should == [Module1, Module2, Module3]
70
81
 
71
- module2.before module1
72
- Frill.decorators.should == [module2, module1]
82
+ Module2.before Module1
83
+ Module3.before Module2
84
+ Frill.decorators.should == [Module3, Module2, Module1]
73
85
  end
74
86
  end
75
87
 
76
88
  describe ".after" do
77
89
  it "inserts the current module after the requested module in Frill's list of decorators" do
78
- Frill.decorators.should == [module1, module2]
90
+ Frill.decorators.should == [Module1, Module2, Module3]
79
91
 
80
- module1.after module2
81
- Frill.decorators.should == [module2, module1]
92
+ Module1.after Module2
93
+ Module3.after Module2
94
+ Frill.decorators.first.should == Module2
95
+ Frill.decorators.last(2).should =~ [Module1, Module3]
82
96
  end
83
97
  end
84
98
 
85
99
  describe ".first" do
86
100
  it "inserts the current module at the beginning of the list of Frill's decorators" do
87
- Frill.decorators.should == [module1, module2]
101
+ Frill.decorators.should == [Module1, Module2, Module3]
88
102
 
89
- module2.first
90
- Frill.decorators.should == [module2, module1]
103
+ Module2.first
104
+ Frill.decorators.first.should == Module2
91
105
  end
92
106
  end
93
107
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-01 00:00:00.000000000 Z
12
+ date: 2012-08-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70317754031900 !ruby/object:Gem::Requirement
16
+ requirement: &70201391629940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70317754031900
24
+ version_requirements: *70201391629940
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70317754031320 !ruby/object:Gem::Requirement
27
+ requirement: &70201391629460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70317754031320
35
+ version_requirements: *70201391629460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &70317754030280 !ruby/object:Gem::Requirement
38
+ requirement: &70201391628600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70317754030280
46
+ version_requirements: *70201391628600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: capybara
49
- requirement: &70317754029580 !ruby/object:Gem::Requirement
49
+ requirement: &70201391627940 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,18 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70317754029580
57
+ version_requirements: *70201391627940
58
+ - !ruby/object:Gem::Dependency
59
+ name: pry
60
+ requirement: &70201391627400 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *70201391627400
58
69
  description:
59
70
  email: moonmaster9000@gmail.com
60
71
  executables: []