acceptance_test 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWMxZjliYjllMzEzNWFjNjc1NmQ3ZWQ2NzMxMTlmNWQyYmE1NjUzMA==
4
+ YzMxMGI3ODQ4MWU1NTY2NjRmMjY4ZGEzYzdhZDRhNjZhZmE1NTdiNQ==
5
5
  data.tar.gz: !binary |-
6
- MDVjMGJiYzEwNzQzNTgyNjk4ZjgyMDRmZDA4ZjgzODk3N2EzZGE3MA==
6
+ YTRiYTBhNTY5MTU5ZmM2MjBkMWUyNGRkMjA0M2ZlNjBlZjI0ZDIyZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDY4ZjlkOGVkY2Y4MTQzMWY0MmFiNmRiMjczYjQ3Y2EyNTNjZmY1YTdmMDll
10
- MDkzNjQzYzdlYzdjNGY5YzhjNTU5NmM4ZTI4MGNiMGE4NWFkOTE4MWJhOGI2
11
- MThkZWUyMDRiYzcyNTdhOWY1MTE5NTlmNWUwYjRmMDcwMTdkMjU=
9
+ YzIyODY3YTdmMmE0NjkyMDE2NmM4OWE5ZjI0YWZlN2U1ZDBhYTE0MTAwYzk3
10
+ OWFkMzIwNjlhMTA4ODZkZThhY2I1ZmNiZjFkOTdhZGViMzdlZGIwMjM2OTA1
11
+ NjcxNjgxNmM5YWQ4NTMzZTU2YWU5NTM3ZjRjZjdlNDA4YWFkMzg=
12
12
  data.tar.gz: !binary |-
13
- YzdiYTdlMzUxMGFmOTAzZjBkN2E4OTI5YjE2YjViZWQ2NDFhN2Q4ODBkNDg5
14
- NzBiNGRmOGVkZTA4ZTI4MDBlYjFmZTkyMGFjMmFkNzEyYWFiMTg3OWZkZDk4
15
- OTg5NWZmM2NmM2U3MzdmMGIwNGVhMjIyMTg1NDVjMjNmNDkxMzc=
13
+ MmE3ZDc0YjRjNjFhNDU4ZGI3OTA3MjMwNTQ3MzA2NTViYjhkN2FlY2Q4OWU1
14
+ Y2QyNTcyZDFiZTA4NDA4MDM4YmQ3ZDA4NzJmMmIzMDcxZDZjYzE2ODk2MWQ1
15
+ M2ZhMDE1ODk3ZGZhMTFkYTM2MWZiMGU2MTllYzA0NTk1MzU1ZDY=
data/CHANGES CHANGED
@@ -119,4 +119,8 @@
119
119
 
120
120
  == Version 1.5.1
121
121
 
122
+ * Refactor the code
123
+
124
+ == Version 1.5.2
125
+
122
126
  * Refactor the code
@@ -1,25 +1,28 @@
1
+ require 'singleton'
1
2
  require 'turnip/capybara'
2
3
  require 'turnip/rspec'
3
- require 'csv'
4
- require 'yaml'
5
- require 'acceptance_test'
6
4
 
5
+ require 'acceptance_test'
7
6
  require 'acceptance_test/gherkin_helper'
8
7
 
9
- class TurnipHelper
10
- attr_reader :acceptance_test
8
+ class AcceptanceTestHelper
9
+ include Singleton
11
10
 
12
11
  def initialize
13
- @acceptance_test = AcceptanceTest.instance
14
-
15
12
  RSpec.configure do |config|
16
13
  config.include Capybara::DSL
17
14
  end
15
+ end
18
16
 
19
- enable_external_source
17
+ def configure config
18
+ AcceptanceTest.instance.configure config
20
19
  end
21
20
 
22
- def register_steps path, class_name, tag, shared_group
21
+ def enable_external_source data_reader
22
+ GherkinHelper.instance.enable_external_source data_reader
23
+ end
24
+
25
+ def register_turnip_steps path, class_name, tag, shared_group
23
26
  require path
24
27
 
25
28
  clazz = Object.const_get(class_name)
@@ -28,14 +31,7 @@ class TurnipHelper
28
31
  config.include clazz, tag => true
29
32
  end
30
33
 
31
- acceptance_test.create_shared_context shared_group
34
+ AcceptanceTest.instance.create_shared_context shared_group
32
35
  end
33
36
 
34
- private
35
-
36
- def enable_external_source # enable external source for gherkin
37
- data_reader = lambda {|source_path| CSV.read(File.expand_path(source_path)) }
38
-
39
- GherkinHelper.instance.enable_external_source data_reader
40
- end
41
37
  end
@@ -1,3 +1,3 @@
1
1
  class AcceptanceTest
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
@@ -1,12 +1,19 @@
1
- require 'acceptance_test/turnip_helper'
1
+ require 'yaml'
2
+ require 'csv'
3
+ require 'active_support/core_ext/hash'
2
4
 
3
- helper = TurnipHelper.new
5
+ require 'acceptance_test/acceptance_test_helper'
4
6
 
5
- config_name = File.expand_path("spec/acceptance_config.yml")
6
- config = HashWithIndifferentAccess.new(YAML.load_file(config_name))
7
+ helper = AcceptanceTestHelper.instance
8
+
9
+ data_reader = lambda {|source_path| CSV.read(File.expand_path(source_path)) }
10
+ helper.enable_external_source data_reader # enable external source for gherkin
7
11
 
8
- helper.acceptance_test.configure config
12
+ helper.register_turnip_steps 'features/steps/wikipedia_steps',
13
+ 'WikipediaSteps', :wikipedia, "WikipediaAcceptanceTest"
9
14
 
10
- helper.register_steps 'features/steps/wikipedia_steps', 'WikipediaSteps', :wikipedia, "WikipediaAcceptanceTest"
15
+ config_name = File.expand_path("spec/acceptance_config.yml")
16
+ config = HashWithIndifferentAccess.new(YAML.load_file(config_name))
11
17
 
18
+ helper.configure config
12
19
 
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.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets
@@ -71,11 +71,11 @@ files:
71
71
  - features/wikipedia/wikipedia_search_from_csv.feature
72
72
  - lib/acceptance_test.rb
73
73
  - lib/acceptance_test/acceptance_test.rb
74
+ - lib/acceptance_test/acceptance_test_helper.rb
74
75
  - lib/acceptance_test/gherkin_helper.rb
75
76
  - lib/acceptance_test/page.rb
76
77
  - lib/acceptance_test/page_set.rb
77
78
  - lib/acceptance_test/screenshot_maker.rb
78
- - lib/acceptance_test/turnip_helper.rb
79
79
  - lib/acceptance_test/version.rb
80
80
  - spec/acceptance_config.yml
81
81
  - spec/features/data.csv