rails5-spec-converter 1.0.3 → 1.0.4

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: 9221acc93243c2c9f8648ad06d5df50a1efa4233
4
- data.tar.gz: a4e9cf2ec31737bd4dff468227b37124aec92fb3
3
+ metadata.gz: 828614a89d1694bc81dafc184bbfa9ac32f60719
4
+ data.tar.gz: dafbae38f00ecc71e583f3415ae28e9f2972e30b
5
5
  SHA512:
6
- metadata.gz: a44c9317b009e1588ba7e0b6a66f9dabb1ecd630a9970ba3116436ef6b2e91aa390ac03fb88b0f8eb35be4366f058c9b049dbd8f1ba2c16843b9d4a4bf7fab41
7
- data.tar.gz: 4607141c2ec87dc5de0a3e02c2a1017929a7d7ae15340ad9676f3a63133e18f5089e44e8bb03991ed8b434f924fa38171a2bc9959c4cb54302b23f433448d427
6
+ metadata.gz: 46e9d313500d4615d4f220bae8381c963668332a5d8803a1870d6fb3fdef58ff394c185d89d3a0b6873652e45bba8d29bbc230abff808b189f64ae572b4f21de
7
+ data.tar.gz: 4eee1870ad1c50952d0d6b443c273817f2470c3ac697d893366c759b6bc6b1477831f545b4a468522960a95e95bf354993bd14f7668c4fa494188f89eb00aebe
@@ -45,13 +45,16 @@ module Rails5
45
45
 
46
46
  def looks_like_route_definition?(hash_node)
47
47
  keys = hash_node.children.map { |pair| pair.children[0].children[0] }
48
- return true if (keys & [:to, :controller]) == keys
48
+ route_definition_keys = [:to, :controller]
49
+ return true if route_definition_keys.all? { |k| keys.include?(k) }
49
50
 
50
51
  hash_node.children.each do |pair|
51
52
  key = pair.children[0].children[0]
52
- value = pair.children[1].children[0]
53
53
  if key == :to
54
- return true if value.match(/^\w+#\w+$/)
54
+ if pair.children[1].str_type?
55
+ value = pair.children[1].children[0]
56
+ return true if value.match(/^\w+#\w+$/)
57
+ end
55
58
  end
56
59
  end
57
60
 
@@ -1,5 +1,5 @@
1
1
  module Rails5
2
2
  module SpecConverter
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails5-spec-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Grathwell