coolerator.vision 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.2.7
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{coolerator.vision}
8
- s.version = "0.2.6"
8
+ s.version = "0.2.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Corey Innis"]
@@ -44,8 +44,9 @@
44
44
  }
45
45
 
46
46
  return {
47
- before : before,
48
- after : after
47
+ filters : filters, // TODO: see about removing this... it's currently only need for the specs.
48
+ before : before,
49
+ after : after
49
50
  };
50
51
  }
51
52
  },
@@ -102,6 +103,6 @@
102
103
  return __database__['*'] || [];
103
104
  }
104
105
 
105
- return $.merge(__database__['*'] || [], __database__[scope] || []);
106
+ return $.merge($.merge([], __database__['*'] || []), __database__[scope] || []);
106
107
  }
107
108
  })(jQuery);
@@ -14,7 +14,8 @@
14
14
 
15
15
  AUTHORS = {
16
16
  "ci" => "Corey Innis",
17
- "rh" => "Rachel Heaton"
17
+ "rh" => "Rachel Heaton",
18
+ "jl" => "Jason Liebrecht"
18
19
  }
19
20
 
20
21
  ## End of configuration
@@ -75,7 +75,17 @@ Screw.Unit(function(c) { with(c) {
75
75
  describe("argument handling", function() {
76
76
  var filters;
77
77
 
78
- context("with appropriate arguments", function() {
78
+ before(function() {
79
+ Coolerator.Filter()
80
+ .before(function() {})
81
+ .after (function() {});
82
+
83
+ Coolerator.Filter('scoped')
84
+ .before(function() {})
85
+ .after (function() {});
86
+ });
87
+
88
+ context("with appropriate arguments (with global)", function() {
79
89
  before(function() {
80
90
  filters = Coolerator.Filters.prepare(view, '*');
81
91
  });
@@ -84,7 +94,11 @@ Screw.Unit(function(c) { with(c) {
84
94
  expect(view.show.jquery).to_not(be_undefined);
85
95
  });
86
96
 
87
- describe("the returned filter helper", function() {
97
+ describe("the returned filters", function() {
98
+ it("are limited to global", function() {
99
+ expect(filters.filters).to(have_length, 1);
100
+ });
101
+
88
102
  it("defines #before", function() {
89
103
  expect(filters.before).to_not(throw_exception);
90
104
  });
@@ -95,6 +109,16 @@ Screw.Unit(function(c) { with(c) {
95
109
  });
96
110
  });
97
111
 
112
+ context("with appropriate arguments (with scoped)", function() {
113
+ it("does not increase the length upon multiple calls", function() {
114
+ Coolerator.Filters.prepare(view, 'scoped');
115
+ Coolerator.Filters.prepare(view, 'scoped');
116
+ filters = Coolerator.Filters.prepare(view, 'scoped');
117
+
118
+ expect(filters.filters).to(have_length, 2);
119
+ });
120
+ });
121
+
98
122
  context("with fewer than two", function() {
99
123
  before(function() {
100
124
  fn = function fn() {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coolerator.vision
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Innis