acceptance_test 1.7.1 → 1.7.2

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: c5a6f1452bd6f0adc7050128629b5b67a5abe04e
4
- data.tar.gz: dd7caafa384ec0312421cfbdd35e07ee9f458f1c
3
+ metadata.gz: ae34aa2cd47d1bbb0ef858917ccf9e96abfb287e
4
+ data.tar.gz: 74123d56a4ce80ecfb91b7c1fde908c27f26971e
5
5
  SHA512:
6
- metadata.gz: f393d462ed43fff25f4a7c82c6fc113a92ddcbebb8de0a6c90a22d930c84f2e8973f698d47954f74fc4890be313488b32f50203df97e561c43cf31c193bcc370
7
- data.tar.gz: 5296f06d5e1c2fc379ee70aff80ba6ab3b200b3017d32842b1a41fd102736c673e48cd0ce30e7bc5dd5ba9df7fbe31e7f96b8a65efe312775e7d011f644795f1
6
+ metadata.gz: a5a59e5fd6d988910c8c186f72020fd57a435ff4f3214657a4ad8246f243ac12f0151642cd00eb2fd3a79d981db815c5bcc358c4304ce7a172531f42fd0cd6f9
7
+ data.tar.gz: 9b4be35e79cede77d65861eee17214c846c9e931666aba0760118e265d58ade32126e43f099e8c2799f5606703da40820a56b8991ee693d4aa704764fe97fc50
data/CHANGES CHANGED
@@ -151,4 +151,8 @@
151
151
 
152
152
  == Version 1.7.1
153
153
 
154
+ * Bug fixes
155
+
156
+ == Version 1.7.2
157
+
154
158
  * Bug fixes
@@ -6,15 +6,19 @@ class PageSet
6
6
  extend Forwardable
7
7
 
8
8
  attr_reader :pages
9
- attr_accessor :session
9
+ attr_accessor :context
10
10
 
11
- def initialize session=nil
12
- @session = session
11
+ def initialize context
12
+ @context = context
13
13
  @pages = []
14
14
  end
15
15
 
16
- def page
17
- session
16
+ # def page
17
+ # context.page
18
+ # end
19
+
20
+ def session
21
+ context.page
18
22
  end
19
23
 
20
24
  def execute &code
@@ -28,7 +32,7 @@ class PageSet
28
32
  end
29
33
 
30
34
  def delegate_to_page page
31
- @pages << page
35
+ pages << page
32
36
 
33
37
  self.class.send :attr_reader, page
34
38
 
@@ -41,25 +45,31 @@ class PageSet
41
45
  clazz.instance_methods - Page.instance_methods
42
46
  end
43
47
 
44
- def enable_smart_completion context
45
- if context
46
- context.class.send(:define_method, :method_missing) do |method_name, *args, &block|
47
- page_set.send method_name, *args, &block
48
- end
48
+ def enable_smart_completion
49
+ context.class.send(:define_method, :method_missing) do |method_name, *args, &block|
50
+ page_set.send method_name, *args, &block
51
+ end
49
52
 
50
- page_set = self
53
+ page_set = self
51
54
 
52
- pages.each do |page|
53
- page_methods(page).each do |method_name|
54
- method = page_set.method(method_name)
55
+ PageSet.class_eval do
56
+ @page_set = page_set # class instance variable
55
57
 
56
- context.class.step "I #{method_name.to_s.gsub('_', ' ')}" do |*args|
57
- page_set.send method_name, *args
58
- end
58
+ def self.page_set # access to class instance variable
59
+ @page_set
60
+ end
61
+ end
62
+
63
+ pages.each do |page|
64
+ page_methods(page).each do |method_name|
65
+ method = page_set.method(method_name)
66
+
67
+ context.class.step "I #{method_name.to_s.gsub('_', ' ')}" do |*args|
68
+ page_set.send method_name, *args
69
+ end
59
70
 
60
- context.class.step "#{method.to_s.gsub('_', ' ')}" do
61
- page_set.send method_name, *args
62
- end
71
+ context.class.step "#{method.to_s.gsub('_', ' ')}" do
72
+ page_set.send method_name, *args
63
73
  end
64
74
  end
65
75
  end
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.7.1"
2
+ VERSION = "1.7.2"
3
3
  end
@@ -9,9 +9,9 @@ steps_for :search_with_pages do
9
9
  step "I am within wikipedia.com" do
10
10
  puts Capybara.current_driver
11
11
 
12
- @page_set = WikipediaPages.new(page)
12
+ @page_set = WikipediaPages.new(self)
13
13
 
14
- page_set.enable_smart_completion(self)
14
+ page_set.enable_smart_completion
15
15
  end
16
16
 
17
17
  step :visit_home_page, "I am on wikipedia.com"
@@ -26,7 +26,7 @@ require 'pages/wikipedia_pages'
26
26
  RSpec.describe 'Wikipedia Search' do
27
27
  include Capybara::DSL
28
28
 
29
- let(:page_set) { WikipediaPages.new(page) }
29
+ let(:page_set) { WikipediaPages.new(self) }
30
30
 
31
31
  before do
32
32
  AcceptanceTest.instance.setup
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acceptance_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets