capybara-ng 0.0.5 → 0.0.6

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: 4acbfb18aaa1bd35e99e42bb590fad2cc321d07a
4
- data.tar.gz: 91ea81b100b497848f2e2d0040544466c0c133e9
3
+ metadata.gz: ee1078d214243d3fe0d47d1cffa2c797a6622b2d
4
+ data.tar.gz: 3bbaf75d9cc3494ebbcd2d970f625a8c4d617ed3
5
5
  SHA512:
6
- metadata.gz: 1f1d68cd2bfe269ad448925509b9c1418ebd73e3204a5fc90087dbf9c7acd974f8cd4f6f5033ca164dd50c804a7bfebf3d89b2bffee8bd144504a052605187cd
7
- data.tar.gz: 1bc652ef7ce2e73f77264e5a2a80af2a2cb45fdf6a4cc2c904409d77840179617705397cabd3cf2b819ef382c091595139c9a8b4da9656cc8922da288fc3002e
6
+ metadata.gz: 1dc56cb845ab105cdad7b127e6114ba2cee00397dfc43f4de9a333c9da26f59c50f28b573128a37e4fd284a7d48114365bfd822db6afbf0b3b6d814635eadf10
7
+ data.tar.gz: 66bf50cf8c1c101c923db57f142ff8b0f67899098ca4caa32aa0b7f090d75000888f33833adf559f1febd45f90e3d1c0e1bd4726af1ab23281ee9508aa0b02ee
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ *.log*
data/lib/angular.rb CHANGED
@@ -4,6 +4,15 @@ require 'capybara'
4
4
  module Angular
5
5
  class NotFound < StandardError
6
6
  end
7
+
8
+ def self.root_selector
9
+ @root_slector ||= 'body'
10
+ end
11
+
12
+ def self.root_selector=(root_selector)
13
+ @root_selector = root_selector
14
+ end
15
+
7
16
  end
8
17
 
9
18
  require 'angular/log'
@@ -1,4 +1,7 @@
1
1
  module Angular
2
+ #
3
+ # TODO KI NOT USED
4
+ #
2
5
  class Driver
3
6
  include Capybara::DSL
4
7
 
data/lib/angular/dsl.rb CHANGED
@@ -4,6 +4,13 @@ module DSL
4
4
  @ng ||= Angular::Setup.new(Capybara.current_session)
5
5
  end
6
6
 
7
+ def ng_root_selector(root_selector = nil)
8
+ if root_selector
9
+ @ng_root_selector = root_selector
10
+ end
11
+ @ng_root_selector || Angular.root_selector
12
+ end
13
+
7
14
  def ng_install
8
15
  ng.install
9
16
  end
@@ -16,14 +23,14 @@ module DSL
16
23
  # @return current location absolute url
17
24
  #
18
25
  def ng_location_abs(opt = {})
19
- selector = opt.delete(:rootSelector) || 'body'
26
+ selector = opt.delete(:rootSelector) || ng_root_selector
20
27
  ng.make_call :getLocationAbsUrl, [selector], opt
21
28
  end
22
29
 
23
30
  # @return current location absolute url
24
31
  #
25
32
  def ng_location(opt = {})
26
- selector = opt.delete(:rootSelector) || 'body'
33
+ selector = opt.delete(:rootSelector) || ng_root_selector
27
34
  ng.make_call :getLocation, [selector], opt
28
35
  end
29
36
 
@@ -31,7 +38,7 @@ module DSL
31
38
  # @return current location
32
39
  #
33
40
  def ng_set_location(url, opt = {})
34
- selector = opt.delete(:rootSelector) || 'body'
41
+ selector = opt.delete(:rootSelector) || ng_root_selector
35
42
  ng.make_call :setLocation, [selector, url], opt
36
43
  end
37
44
 
@@ -42,7 +49,7 @@ module DSL
42
49
  # @return eval result
43
50
  #
44
51
  def ng_eval(expr, opt = {})
45
- selector = opt.delete(:rootSelector) || 'body'
52
+ selector = opt.delete(:rootSelector) || ng_root_selector
46
53
  ng.make_call :evaluate, [selector, expr], opt
47
54
  end
48
55
 
@@ -1,4 +1,7 @@
1
1
  module Angular
2
+ #
3
+ # TODO KI NOT USED
4
+ #
2
5
  # Build the helper 'element' function for a given instance of Protractor.
3
6
  #
4
7
  # @private
@@ -1,4 +1,7 @@
1
1
  module Angular
2
+ #
3
+ # TODO KI NOT USED
4
+ #
2
5
  module Locator
3
6
  def binding
4
7
  <<-FN
data/lib/angular/setup.rb CHANGED
@@ -27,7 +27,7 @@ module Angular
27
27
  opt = {
28
28
  nodes: true,
29
29
  using: nil,
30
- rootSelector: 'body',
30
+ rootSelector: Angular.root_selector,
31
31
  }.merge(opt)
32
32
  make_call(method, params, opt)
33
33
  end
@@ -1,3 +1,3 @@
1
1
  module Angular
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - kari