vignette 0.0.17 → 0.0.18

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: 9039cedf8647c0a9fed3af2baf4b8011394929ce
4
- data.tar.gz: 0d80b115aeb70c0431f9aab3a77f008545e805c3
3
+ metadata.gz: c9db895564914a5387c5822faf6a42c591f96d76
4
+ data.tar.gz: dcb11d3ae9e4f9584db8f69ff262661a1108511d
5
5
  SHA512:
6
- metadata.gz: 32ecca1cb94d72395487b6f68aa76c96104324a3ecd26a95d639f4f07a59446d8e3993cd2241b66c6648bc863928da5221223ebdc583a5de1a2780da9fdbc312
7
- data.tar.gz: 1969cbb84d8c21b44b2d24fe0a6486e69dc94193ed75e55bfd0c026ff69024c4914e0bcfffa9cd30fcf900b57cd8c2f2774d971e9862fbc15afb749d444c2982
6
+ metadata.gz: 16e6a8f1850a236814373aab8433b9b7a286e2d818f878c1d0df29c0b5af6401e72e1f972a3be59ed7f0228b15bbc6c663e75c2646e6cd69df3293ef7f142315
7
+ data.tar.gz: bccdef2544d9f9f3e17b43372b4924b8b5f3e226b4e2bf6974ccc485dd8db226de72d87bc119e7a5a31b45dccb198e9ee27c095e1652bfd7fa68994ebb6d0d3e
data/README.md CHANGED
@@ -62,9 +62,9 @@ Vignette `tests` are identified by a checksum of the Array, and thus, changing t
62
62
  Test <strong>two</strong>
63
63
  Test #{three}
64
64
 
65
- The choices for these tests are exposed through the `Vignette.test` method:
65
+ The choices for these tests are exposed through the `Vignette.tests` method:
66
66
 
67
- Vignette.test -> { '(app/views/users/new.html.haml:35)' => 'Test one' } # First choice was select for new.html.haml test line 35
67
+ Vignette.tests -> { '(app/views/users/new.html.haml:35)' => 'Test one' } # First choice was select for new.html.haml test line 35
68
68
 
69
69
  You may store these values as properties in your analytics system.
70
70
 
@@ -98,7 +98,7 @@ module Vignette
98
98
 
99
99
  name_values = vig.values.map { |v| [ v['n'], [ v['t'], v['v'] ] ] }.group_by { |el| el[0] }
100
100
 
101
- arr = name_values.map { |k,v| [ k.to_sym, v.sort { |a,b| b[1][0] <=> a[1][0] }.first[1][1] ] }
101
+ arr = name_values.map { |k,v| [ k.to_s.to_sym, v.sort { |a,b| b[1][0] <=> a[1][0] }.first[1][1] ] }
102
102
 
103
103
  Hash[arr]
104
104
  end
@@ -1,3 +1,3 @@
1
1
  module Vignette
2
- VERSION = "0.0.17"
2
+ VERSION = "0.0.18"
3
3
  end
@@ -28,6 +28,11 @@ describe Vignette do
28
28
  expect(array.vignette).to eq('b'); new_line = __LINE__
29
29
  expect(Vignette.tests).to eq({:"(vignette_spec.rb:#{line})" => 'b'})
30
30
  end
31
+
32
+ it 'should handle vignettes with number as names' do
33
+ expect(%w{a a a}.vignette(0)).to eq('a')
34
+ expect(Vignette.tests).to eq(:"0" => "a")
35
+ end
31
36
  end
32
37
 
33
38
  context "for multiple runs" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vignette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Hayes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport