angular_sprinkles 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b98b1f950bd9ba6a35bf77bc27e7eedfe5bd398a
4
- data.tar.gz: 244a920a5a001772fa655347789a1a45cce1d135
3
+ metadata.gz: f2f319c333ef62df99ce38f1283be024f3f14477
4
+ data.tar.gz: 849dfd932ebb1c60be65283e11ff205a58ed28da
5
5
  SHA512:
6
- metadata.gz: d8c849f5f46ff67e8395744c3bcd524eec772a73b45a6c22760ebcb3c23f81162bb8226e10a01e1085d8280a4d68a3c5aa64fe205217c1144d4345d84818a721
7
- data.tar.gz: b573c8d126a8d5fcf9fd92bb34e62051e3b5826b8f00b45c644d15c9c42dfee7190ec8d3b752048bba00c020dbcfb19f64be691938c8cd5e0334d32237da6a76
6
+ metadata.gz: bd87b46e1bc7f03482f2bd517d1c843a23aa5710e658ee1ee22ca66f2ace9289e85049aaa97e94e5e289e83512202bd44648ce9475b1a850aad866b06ed3e7cd
7
+ data.tar.gz: 32af876fc588272a8dec951bf92a5d13684592be338097b9b07566c44bb9d20d6353038079d00ac6042466cfcd5edffdc8d9375c54949d831b7c80361f8bdc99
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.2.13
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: angular_sprinkles 0.2.12 ruby lib
5
+ # stub: angular_sprinkles 0.2.13 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "angular_sprinkles"
9
- s.version = "0.2.12"
9
+ s.version = "0.2.13"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -12,7 +12,9 @@ module AngularSprinkles
12
12
  private
13
13
 
14
14
  def to_json_hash
15
- Hash[@args.map { |k, v| [k, v.to_json] }]
15
+ Hash[@args.map do |k, v|
16
+ [k, v.is_a?(String) ? v : v.to_json]
17
+ end]
16
18
  end
17
19
  end
18
20
  end
@@ -1,11 +1,23 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe AngularSprinkles::Directive::Input do
4
- let(:args) { { key: 'value' } }
4
+ let(:args) { { key: value } }
5
5
 
6
6
  subject { described_class.new(args) }
7
7
 
8
- it 'turns the args hash into a jsonified data hash' do
9
- expect(subject.attributes).to eq({ data: { key: "\"value\"" } })
8
+ context "when the value is a string" do
9
+ let(:value) { "value" }
10
+
11
+ it "does nothing to the value" do
12
+ expect(subject.attributes).to eq({ data: args })
13
+ end
14
+ end
15
+
16
+ context "when the value is not a string" do
17
+ let(:value) { double(to_json: 1) }
18
+
19
+ it "turns the args hash into a jsonified data hash" do
20
+ expect(subject.attributes).to eq({ data: { key: 1 } })
21
+ end
10
22
  end
11
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular_sprinkles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Scholz