taza 3.0.0 → 4.0.0
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 +5 -5
- data/History.txt +2 -0
- data/README.md +3 -2
- data/lib/taza/generators/project_generator.rb +5 -5
- data/lib/taza/site.rb +6 -2
- data/lib/taza/version.rb +1 -1
- data/spec/generators/flow_generator_spec.rb +1 -1
- data/spec/generators/page_generator_spec.rb +2 -2
- data/spec/generators/partial_generator_spec.rb +1 -1
- data/spec/generators/project_generator_spec.rb +7 -7
- data/spec/generators/site_generator_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -3
- data/spec/taza/browser_spec.rb +8 -8
- data/spec/taza/fixtures_spec.rb +9 -8
- data/spec/taza/page_module_spec.rb +5 -5
- data/spec/taza/page_spec.rb +19 -17
- data/spec/taza/settings_spec.rb +1 -1
- data/spec/taza/site_fixtures_spec.rb +9 -4
- data/spec/taza/site_spec.rb +9 -10
- metadata +40 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: caeaad92ea65ec84cfe2e36775a1e263829bd1e8cf91d4bc55b0478ebcab83a4
|
4
|
+
data.tar.gz: 0c59e875770890272dceb83ba3c2f76b69ab61e86ac36524ea31d14c2ef73d0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af6ddbcaf9b4f386266e33ee7109901d2d5b47b257899416b102dca8c3d73b66126719a42eed17e7d7ec6f2a0d46a846b1cd07b359633f74f8b35955b621d13
|
7
|
+
data.tar.gz: 97328065e422959c1157e967355e4d3d87089db3d0a395d7c4ba788d8e4a5aac648143dddfd3a469cb8f5ecff56e7c2a15a54b9a684625f22042e758ecc1693a
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
#taza [](https://badge.fury.io/rb/taza)
|
1
|
+
# taza [](https://badge.fury.io/rb/taza)
|
2
|
+
|
2
3
|
## Build Status
|
3
4
|
###### Master
|
4
|
-
[](https://travis-ci.org/hammernight/taza) [](https://codeclimate.com/github/hammernight/taza) [](https://snap-ci.com/hammernight/taza/branch/master)
|
5
5
|
|
6
|
+

|
6
7
|
|
7
8
|
* https://github.com/hammernight/taza
|
8
9
|
* Wiki: http://github.com/scudco/taza/wikis
|
@@ -15,16 +15,16 @@ module Taza
|
|
15
15
|
|
16
16
|
desc "This creates the Taza project structure. Example taza create foo"
|
17
17
|
def create
|
18
|
-
template('templates/project/Gemfile.tt', 'Gemfile') unless File.
|
19
|
-
template('templates/project/Rakefile.tt', 'Rakefile') unless File.
|
20
|
-
template('templates/project/config.yml.tt', 'config/config.yml') unless File.
|
18
|
+
template('templates/project/Gemfile.tt', 'Gemfile') unless File.exist? 'Gemfile'
|
19
|
+
template('templates/project/Rakefile.tt', 'Rakefile') unless File.exist? 'Rakefile'
|
20
|
+
template('templates/project/config.yml.tt', 'config/config.yml') unless File.exist? 'config/config.yml'
|
21
21
|
empty_directory 'lib/sites'
|
22
22
|
empty_directory 'spec'
|
23
|
-
template('templates/project/spec_helper.rb.tt', 'spec/spec_helper.rb') unless File.
|
23
|
+
template('templates/project/spec_helper.rb.tt', 'spec/spec_helper.rb') unless File.exist? 'spec/spec_helper.rb'
|
24
24
|
empty_directory 'spec/isolation'
|
25
25
|
empty_directory 'spec/integration'
|
26
26
|
empty_directory 'bin'
|
27
|
-
template('templates/project/taza.tt', 'bin/taza') unless File.
|
27
|
+
template('templates/project/taza.tt', 'bin/taza') unless File.exist? 'bin/taza'
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
data/lib/taza/site.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Taza
|
3
2
|
# An abstraction of a website, but more really a container for a sites pages.
|
4
3
|
#
|
@@ -49,7 +48,12 @@ module Taza
|
|
49
48
|
# :browser => a browser object to act on instead of creating one automatically
|
50
49
|
# :url => the url of where to start the site
|
51
50
|
def initialize(params={},&block)
|
52
|
-
|
51
|
+
if self.class.respond_to?(:module_parent)
|
52
|
+
@module_name = self.class.module_parent.to_s
|
53
|
+
else
|
54
|
+
@module_name = self.class.parent.to_s
|
55
|
+
end
|
56
|
+
|
53
57
|
@class_name = self.class.to_s.split("::").last
|
54
58
|
define_site_pages
|
55
59
|
define_flows
|
data/lib/taza/version.rb
CHANGED
@@ -14,7 +14,7 @@ describe Taza::FlowGenerator do
|
|
14
14
|
|
15
15
|
it 'a checkout.rb' do
|
16
16
|
expect(output).to include('lib/sites/foo_site/flows/checkout.rb')
|
17
|
-
expect(File.
|
17
|
+
expect(File.exist?('lib/sites/foo_site/flows/checkout.rb')).to be true
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'a message if site does not exist' do
|
@@ -15,11 +15,11 @@ describe Taza::PageGenerator do
|
|
15
15
|
|
16
16
|
it 'creates a checkout_page.rb' do
|
17
17
|
expect(output).to include('lib/sites/foo_site/pages/home_page.rb')
|
18
|
-
expect(File.
|
18
|
+
expect(File.exist?('lib/sites/foo_site/pages/home_page.rb')).to be true
|
19
19
|
end
|
20
20
|
it 'creates a checkout_page_spec.rb' do
|
21
21
|
expect(output).to include('spec/isolation/home_page_spec.rb')
|
22
|
-
expect(File.
|
22
|
+
expect(File.exist?('spec/isolation/home_page_spec.rb')).to be true
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'gives message if site does not exist' do
|
@@ -14,7 +14,7 @@ describe Taza::PartialGenerator do
|
|
14
14
|
|
15
15
|
it 'a navigation.rb' do
|
16
16
|
expect(output).to include('lib/sites/foo_site/pages/partials/navigation.rb')
|
17
|
-
expect(File.
|
17
|
+
expect(File.exist?('lib/sites/foo_site/pages/partials/navigation.rb')).to be true
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'message if site does not exist' do
|
@@ -9,12 +9,12 @@ describe Taza::ProjectGenerator do
|
|
9
9
|
|
10
10
|
it 'a Gemfile' do
|
11
11
|
expect(output).to include("Gemfile")
|
12
|
-
expect(File.
|
12
|
+
expect(File.exist?('Gemfile')).to be true
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'a Rakefile' do
|
16
16
|
expect(output).to include('Rakefile')
|
17
|
-
expect(File.
|
17
|
+
expect(File.exist?('Rakefile')).to be true
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'the Rakefile can be required' do
|
@@ -24,7 +24,7 @@ describe Taza::ProjectGenerator do
|
|
24
24
|
|
25
25
|
it 'config/config.yml' do
|
26
26
|
expect(output).to include('config/config.yml')
|
27
|
-
expect(File.
|
27
|
+
expect(File.exist?('config/config.yml')).to be true
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'lib/sites' do
|
@@ -34,7 +34,7 @@ describe Taza::ProjectGenerator do
|
|
34
34
|
|
35
35
|
it 'a spec_helper.rb' do
|
36
36
|
expect(output).to include('spec/spec_helper.rb')
|
37
|
-
expect(File.
|
37
|
+
expect(File.exist?('spec/spec_helper.rb')).to be true
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'spec_helper.rb can be required' do
|
@@ -59,17 +59,17 @@ describe Taza::ProjectGenerator do
|
|
59
59
|
|
60
60
|
it 'the taza executable' do
|
61
61
|
expect(output).to include('spec/spec_helper.rb')
|
62
|
-
expect(File.
|
62
|
+
expect(File.exist?('spec/spec_helper.rb')).to be true
|
63
63
|
end
|
64
64
|
|
65
65
|
xit "should generate a console script" do
|
66
66
|
run_generator('taza', [APP_ROOT], generator_sources)
|
67
|
-
expect(File.
|
67
|
+
expect(File.exist?(File.join(APP_ROOT, 'script', 'console'))).to be true
|
68
68
|
end
|
69
69
|
|
70
70
|
xit "should generate a windows console script" do
|
71
71
|
run_generator('taza', [APP_ROOT], generator_sources)
|
72
|
-
expect(File.
|
72
|
+
expect(File.exist?(File.join(APP_ROOT, 'script', 'console.cmd'))).to be true
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -9,7 +9,7 @@ describe Taza::SiteGenerator do
|
|
9
9
|
|
10
10
|
it 'foo_site.rb' do
|
11
11
|
expect(output).to include('lib/sites/foo_site.rb')
|
12
|
-
expect(File.
|
12
|
+
expect(File.exist?('lib/sites/foo_site.rb')).to be true
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'lib/sites/foo_site' do
|
@@ -34,7 +34,7 @@ describe Taza::SiteGenerator do
|
|
34
34
|
|
35
35
|
it 'config/foo_site.yml' do
|
36
36
|
expect(output).to include("config/foo_site.yml")
|
37
|
-
expect(File.
|
37
|
+
expect(File.exist?('config/foo_site.yml')).to be true
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'does not overwrite existing site' do
|
data/spec/spec_helper.rb
CHANGED
@@ -3,12 +3,11 @@ require 'bundler/setup'
|
|
3
3
|
require 'mocha'
|
4
4
|
require 'taza'
|
5
5
|
require 'thor'
|
6
|
-
require 'watir
|
6
|
+
require 'watir'
|
7
7
|
require 'selenium-webdriver'
|
8
8
|
|
9
9
|
RSpec.configure do |config|
|
10
10
|
config.mock_with :mocha
|
11
|
-
|
12
11
|
config.before(:each) do
|
13
12
|
$0 = 'home'
|
14
13
|
ARGV.clear
|
@@ -35,7 +34,7 @@ RSpec.configure do |config|
|
|
35
34
|
end
|
36
35
|
|
37
36
|
def null_device
|
38
|
-
File.
|
37
|
+
File.exist?('/dev/null') ? '/dev/null' : 'NUL'
|
39
38
|
end
|
40
39
|
|
41
40
|
# Must set before requiring generator libs.
|
data/spec/taza/browser_spec.rb
CHANGED
@@ -13,13 +13,13 @@ describe Taza::Browser do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should raise unknown browser error for unsupported watir browsers" do
|
16
|
-
expect
|
16
|
+
expect { Taza::Browser.create(:browser => :foo_browser_9000, :driver => :watir) }.to raise_error(StandardError)
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should use params browser type when creating selenium" do
|
20
20
|
skip "Travis cant load selenium. :("
|
21
21
|
browser_type = :opera
|
22
|
-
Selenium::SeleniumDriver.expects(:new).with(anything,anything,'*opera',anything)
|
22
|
+
Selenium::SeleniumDriver.expects(:new).with(anything, anything, '*opera', anything)
|
23
23
|
Taza::Browser.create(:browser => browser_type, :driver => :selenium)
|
24
24
|
end
|
25
25
|
|
@@ -43,19 +43,19 @@ describe Taza::Browser do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should use environment settings for server port and ip" do
|
46
|
-
#TODO:we need to make this more dynamic and move the skeleton project to the temp dir
|
47
|
-
Taza::Settings.stubs(:path).returns(File.join(@original_directory,'spec','sandbox'))
|
46
|
+
# TODO:we need to make this more dynamic and move the skeleton project to the temp dir
|
47
|
+
Taza::Settings.stubs(:path).returns(File.join(@original_directory, 'spec', 'sandbox'))
|
48
48
|
ENV['SERVER_PORT'] = 'server_port'
|
49
49
|
ENV['SERVER_IP'] = 'server_ip'
|
50
|
-
Selenium::SeleniumDriver.expects(:new).with('server_ip','server_port',anything,anything)
|
50
|
+
Selenium::SeleniumDriver.expects(:new).with('server_ip', 'server_port', anything, anything)
|
51
51
|
Taza::Browser.create(
|
52
|
-
|
52
|
+
Taza::Settings.config("SiteName"))
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should use environment settings for timeout" do
|
56
|
-
Taza::Settings.stubs(:path).returns(File.join(@original_directory,'spec','sandbox'))
|
56
|
+
Taza::Settings.stubs(:path).returns(File.join(@original_directory, 'spec', 'sandbox'))
|
57
57
|
ENV['TIMEOUT'] = 'timeout'
|
58
|
-
Selenium::SeleniumDriver.expects(:new).with(anything,anything,anything,'timeout')
|
58
|
+
Selenium::SeleniumDriver.expects(:new).with(anything, anything, anything, 'timeout')
|
59
59
|
Taza::Browser.create(Taza::Settings.config("SiteName"))
|
60
60
|
end
|
61
61
|
|
data/spec/taza/fixtures_spec.rb
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
3
|
describe "Taza::Fixtures" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
before do
|
5
|
+
stub_path = File.join(@original_directory, 'spec', 'sandbox', 'fixtures', '')
|
6
|
+
Taza::Fixture.stubs(:base_path).returns(stub_path)
|
7
|
+
Taza.load_fixtures
|
8
|
+
self.class.include(Taza::Fixtures)
|
9
|
+
end
|
9
10
|
|
10
11
|
it "should be able to look up a fixture entity off fixture_methods module" do
|
11
12
|
expect(examples(:first_example).name).to eql 'first'
|
12
13
|
end
|
13
14
|
|
14
15
|
it "should still raise method missing error" do
|
15
|
-
expect
|
16
|
+
expect{ zomgwtf(:first_example) }.to raise_error(NoMethodError)
|
16
17
|
end
|
17
18
|
|
18
|
-
#TODO: this test tests what is in entity's instance eval not happy with it being here
|
19
|
+
# TODO: this test tests what is in entity's instance eval not happy with it being here
|
19
20
|
it "should be able to look up a fixture entity off fixture_methods module" do
|
20
21
|
expect(examples(:first_example).user.name).to eql users(:shatner).name
|
21
22
|
end
|
@@ -30,7 +31,7 @@ describe "Taza::Fixtures" do
|
|
30
31
|
end
|
31
32
|
|
32
33
|
it "should not be able to access fixtures in sub-folders if not included" do
|
33
|
-
expect
|
34
|
+
expect{ bars(:foo) }.to raise_error(NoMethodError)
|
34
35
|
end
|
35
36
|
|
36
37
|
it "should template fixture files" do
|
@@ -27,7 +27,7 @@ describe "Taza Page Module" do
|
|
27
27
|
|
28
28
|
|
29
29
|
it "should not execute elements that belong to a page module but accessed without it" do
|
30
|
-
expect
|
30
|
+
expect{ AnotherPageWithModule.new.another_module_element }.to raise_error(NoMethodError)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should execute elements in the context of their page module when accessed with it" do
|
@@ -100,7 +100,7 @@ describe "Taza Page Module" do
|
|
100
100
|
|
101
101
|
it "should raise an error for page-module filters that return false" do
|
102
102
|
page = PageWithFalseFilterAndModule.new(:module)
|
103
|
-
expect
|
103
|
+
expect{ page.sample_element }.to raise_error(Taza::FilterError)
|
104
104
|
end
|
105
105
|
|
106
106
|
class PageWithFilterAndModuleElements < ::Taza::Page
|
@@ -116,7 +116,7 @@ describe "Taza Page Module" do
|
|
116
116
|
|
117
117
|
it "should execute filters for elements inside page modules" do
|
118
118
|
page = PageWithFilterAndModuleElements.new(:module)
|
119
|
-
expect
|
119
|
+
expect{ page.sample_element }.to raise_error(Taza::FilterError)
|
120
120
|
end
|
121
121
|
|
122
122
|
class PageWithFiltersAndModuleElements < ::Taza::Page
|
@@ -139,7 +139,7 @@ describe "Taza Page Module" do
|
|
139
139
|
|
140
140
|
it "should execute filters for specific and all elements inside page modules" do
|
141
141
|
page = PageWithFiltersAndModuleElements.new(:module)
|
142
|
-
expect
|
142
|
+
expect{ page.sample_element }.to raise_error(Taza::FilterError)
|
143
143
|
expect(page.another_sample_element).to eql :something
|
144
144
|
end
|
145
145
|
|
@@ -167,7 +167,7 @@ describe "Taza Page Module" do
|
|
167
167
|
foo = PageWithFiltersAndModulesAndElements.new(:foo_module)
|
168
168
|
expect(foo.sample_element).to eql :something
|
169
169
|
bar = PageWithFiltersAndModulesAndElements.new(:bar_module)
|
170
|
-
expect
|
170
|
+
expect{ bar.sample_element }.to raise_error(Taza::FilterError)
|
171
171
|
end
|
172
172
|
|
173
173
|
end
|
data/spec/taza/page_spec.rb
CHANGED
@@ -4,8 +4,9 @@ require 'taza/page'
|
|
4
4
|
describe Taza::Page do
|
5
5
|
|
6
6
|
class ElementAndFilterContextExample < Taza::Page
|
7
|
-
element(:sample_element) {browser}
|
7
|
+
element(:sample_element) { browser }
|
8
8
|
filter(:sample_filter, :sample_element)
|
9
|
+
|
9
10
|
def sample_filter
|
10
11
|
browser
|
11
12
|
end
|
@@ -14,6 +15,7 @@ describe Taza::Page do
|
|
14
15
|
class RecursiveFilterExample < Taza::Page
|
15
16
|
element(:foo) {}
|
16
17
|
filter :sample_filter
|
18
|
+
|
17
19
|
def sample_filter
|
18
20
|
foo
|
19
21
|
true
|
@@ -26,12 +28,12 @@ describe Taza::Page do
|
|
26
28
|
end
|
27
29
|
|
28
30
|
it "should execute an element's block with the params provided for its method" do
|
29
|
-
Taza::Page.element(:boo){|baz| baz}
|
31
|
+
Taza::Page.element(:boo) { |baz| baz }
|
30
32
|
expect(Taza::Page.new.boo("rofl")).to eql 'rofl'
|
31
|
-
|
33
|
+
end
|
32
34
|
|
33
35
|
it "element's name can not be nil" do
|
34
|
-
expect{ Taza::Page.element(nil){
|
36
|
+
expect { Taza::Page.element(nil) {} }.to raise_error(Taza::ElementError)
|
35
37
|
end
|
36
38
|
|
37
39
|
it "should execute elements and filters in the context of the page instance" do
|
@@ -62,25 +64,25 @@ describe Taza::Page do
|
|
62
64
|
end
|
63
65
|
|
64
66
|
it "should filter all elements if element argument is not provided" do
|
65
|
-
expect
|
66
|
-
expect
|
67
|
+
expect { FilterAllElements.new.apple }.to raise_error(Taza::FilterError)
|
68
|
+
expect { FilterAllElements.new.foo }.to raise_error(Taza::FilterError)
|
67
69
|
end
|
68
70
|
|
69
71
|
it "should have empty elements on a new class" do
|
70
|
-
foo = Class::new(superclass=Taza::Page)
|
72
|
+
foo = Class::new(superclass = Taza::Page)
|
71
73
|
expect(foo.elements).to_not be_nil
|
72
74
|
expect(foo.elements).to be_empty
|
73
75
|
end
|
74
76
|
|
75
77
|
it "should have empty filters on a new class" do
|
76
|
-
foo = Class::new(superclass=Taza::Page)
|
78
|
+
foo = Class::new(superclass = Taza::Page)
|
77
79
|
expect(foo.filters).to_not be_nil
|
78
80
|
expect(foo.filters).to be_empty
|
79
81
|
end
|
80
82
|
|
81
83
|
class FilterAnElement < Taza::Page
|
82
84
|
attr_accessor :called_element_method
|
83
|
-
element(:false_item) { @called_element_method = true}
|
85
|
+
element(:false_item) { @called_element_method = true }
|
84
86
|
filter :false_filter, :false_item
|
85
87
|
|
86
88
|
def false_filter
|
@@ -89,21 +91,21 @@ describe Taza::Page do
|
|
89
91
|
end
|
90
92
|
|
91
93
|
it "should raise a error if an elements is called and its filter returns false" do
|
92
|
-
expect
|
94
|
+
expect { FilterAnElement.new.false_item }.to raise_error(Taza::FilterError)
|
93
95
|
end
|
94
96
|
|
95
97
|
it "should not call element block if filters fail" do
|
96
98
|
page = FilterAnElement.new
|
97
|
-
expect
|
99
|
+
expect { page.false_item }.to raise_error(Taza::FilterError)
|
98
100
|
expect(page.called_element_method).to_not be true
|
99
101
|
end
|
100
102
|
|
101
103
|
it "should not allow more than one element descriptor with the same element name" do
|
102
|
-
expect
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
104
|
+
expect {
|
105
|
+
class DuplicateElements < Taza::Page
|
106
|
+
element(:foo) { true }
|
107
|
+
element(:foo) { false }
|
108
|
+
end
|
109
|
+
}.to raise_error(Taza::ElementError)
|
108
110
|
end
|
109
111
|
end
|
data/spec/taza/settings_spec.rb
CHANGED
@@ -67,7 +67,7 @@ describe Taza::Settings do
|
|
67
67
|
|
68
68
|
it "should raise error for a config file that doesnot exist" do
|
69
69
|
Taza::Settings.stubs(:path).returns("#{@original_directory}/spec/sandbox/file_not_exists.yml")
|
70
|
-
expect
|
70
|
+
expect{Taza::Settings.config}.to raise_error(ArgumentError)
|
71
71
|
end
|
72
72
|
|
73
73
|
it "should path point at root directory" do
|
@@ -1,14 +1,19 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
describe "Site Specific Fixtures" do
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
|
4
|
+
before do
|
5
|
+
stub_path = File.join(@original_directory, 'spec', 'sandbox', 'fixtures', '')
|
6
|
+
Taza::Fixture.stubs(:base_path).returns(stub_path)
|
7
|
+
Taza.load_fixtures
|
8
|
+
self.class.include(Taza::Fixtures::FooSite)
|
9
|
+
end
|
6
10
|
|
7
11
|
it "should be able to access fixtures in sub-folders" do
|
8
12
|
expect(bars(:foo).name).to eql 'foo'
|
9
13
|
end
|
10
14
|
|
11
15
|
it "should not be able to access non-site-specific fixtures" do
|
12
|
-
expect
|
16
|
+
expect { foos(:gap) }.to raise_error(NoMethodError)
|
13
17
|
end
|
18
|
+
|
14
19
|
end
|
data/spec/taza/site_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Taza::Site do
|
|
11
11
|
before(:all) do
|
12
12
|
Foo = Class.new(Taza::Site)
|
13
13
|
end
|
14
|
-
#TODO: we need to clean up these tests and remove the warning below
|
14
|
+
# TODO: we need to clean up these tests and remove the warning below
|
15
15
|
#/Users/bisbot/Projects/Taza/taza/spec/taza/site_spec.rb:15: warning: already initialized constant Foo
|
16
16
|
before :each do
|
17
17
|
@pages_path = File.join(@original_directory, 'spec', 'sandbox', 'pages', 'foo', '**', '*.rb')
|
@@ -74,7 +74,7 @@ describe Taza::Site do
|
|
74
74
|
browser = stub_browser
|
75
75
|
browser.expects(:close)
|
76
76
|
Taza::Browser.stubs(:create).returns(browser)
|
77
|
-
expect
|
77
|
+
expect { Foo.new { |site| raise StandardError } }.to raise_error(StandardError)
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'should not close browser if block not given' do
|
@@ -90,21 +90,21 @@ describe Taza::Site do
|
|
90
90
|
browser.stubs(:goto).raises(StandardError, 'ErrorOnBrowserGoto')
|
91
91
|
browser.expects(:close).never
|
92
92
|
Taza::Browser.stubs(:create).returns(browser)
|
93
|
-
expect
|
93
|
+
expect { Foo.new }.to raise_error(StandardError, 'ErrorOnBrowserGoto')
|
94
94
|
end
|
95
95
|
|
96
96
|
it 'should raise browser close error if no other errors' do
|
97
97
|
browser = stub_browser
|
98
98
|
browser.expects(:close).raises(StandardError, 'BrowserCloseError')
|
99
99
|
Taza::Browser.stubs(:create).returns(browser)
|
100
|
-
expect
|
100
|
+
expect { Foo.new {} }.to raise_error(StandardError, 'BrowserCloseError')
|
101
101
|
end
|
102
102
|
|
103
103
|
it 'should raise error inside block if both it and browser.close throws an error' do
|
104
104
|
browser = stub_browser
|
105
105
|
browser.expects(:close).raises(StandardError, 'BrowserCloseError')
|
106
106
|
Taza::Browser.stubs(:create).returns(browser)
|
107
|
-
expect
|
107
|
+
expect { Foo.new { |site| raise StandardError, 'innererror' } }.to raise_error(StandardError, 'innererror')
|
108
108
|
end
|
109
109
|
|
110
110
|
it 'should close a browser if block given' do
|
@@ -175,7 +175,7 @@ describe Taza::Site do
|
|
175
175
|
browser.expects(:close).then(browser_state.is('off'))
|
176
176
|
browser.expects(:doit).when(browser_state.is('on'))
|
177
177
|
Taza::Site.before_browser_closes { |browser| browser.doit }
|
178
|
-
expect
|
178
|
+
expect { Foo.new { |site| raise StandardError, 'innererror' } }.to raise_error(StandardError, 'innererror')
|
179
179
|
end
|
180
180
|
|
181
181
|
it 'should still close its browser if #before_browser_closes raises an exception' do
|
@@ -183,7 +183,7 @@ describe Taza::Site do
|
|
183
183
|
Taza::Browser.stubs(:create).returns(browser)
|
184
184
|
browser.expects(:close)
|
185
185
|
Taza::Site.before_browser_closes { |browser| raise StandardError, 'foo error' }
|
186
|
-
expect
|
186
|
+
expect { Foo.new {} }.to raise_error(StandardError, 'foo error')
|
187
187
|
end
|
188
188
|
|
189
189
|
it 'should not close a browser it did not make' do
|
@@ -199,7 +199,6 @@ describe Taza::Site do
|
|
199
199
|
Foo.new() {}
|
200
200
|
end
|
201
201
|
|
202
|
-
|
203
202
|
module Zoro
|
204
203
|
class Zoro < ::Taza::Site
|
205
204
|
end
|
@@ -240,7 +239,7 @@ describe Taza::Site do
|
|
240
239
|
f.baz(:another_module) do |baz|
|
241
240
|
barzor = baz
|
242
241
|
end
|
243
|
-
expect
|
242
|
+
expect { barzor.other_element }.to raise_error(NoMethodError)
|
244
243
|
end
|
245
244
|
|
246
245
|
it 'should have a way to keep the browser instance open' do
|
@@ -256,6 +255,6 @@ describe Taza::Site do
|
|
256
255
|
browser.expects(:close).never
|
257
256
|
Taza::Browser.stubs(:create).returns(browser)
|
258
257
|
Taza::Site.donot_close_browser
|
259
|
-
expect
|
258
|
+
expect { Foo.new { |site| raise StandardError } }.to raise_error(StandardError)
|
260
259
|
end
|
261
260
|
end
|
metadata
CHANGED
@@ -1,129 +1,128 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Anderson
|
8
8
|
- Pedro Nascimento
|
9
9
|
- Oscar Rieken
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2025-04-13 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
15
|
+
name: user-choices
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
17
|
requirements:
|
19
|
-
- - "
|
18
|
+
- - "~>"
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
20
|
+
version: 1.1.0
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
|
-
- - "
|
25
|
+
- - "~>"
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
27
|
+
version: 1.1.0
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
|
-
name:
|
29
|
+
name: Selenium
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
32
31
|
requirements:
|
33
|
-
- - "
|
32
|
+
- - "~>"
|
34
33
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
34
|
+
version: 1.1.0
|
36
35
|
type: :runtime
|
37
36
|
prerelease: false
|
38
37
|
version_requirements: !ruby/object:Gem::Requirement
|
39
38
|
requirements:
|
40
|
-
- - "
|
39
|
+
- - "~>"
|
41
40
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
41
|
+
version: 1.1.0
|
43
42
|
- !ruby/object:Gem::Dependency
|
44
|
-
name:
|
43
|
+
name: watir
|
45
44
|
requirement: !ruby/object:Gem::Requirement
|
46
45
|
requirements:
|
47
46
|
- - "~>"
|
48
47
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
48
|
+
version: 7.3.0
|
50
49
|
type: :runtime
|
51
50
|
prerelease: false
|
52
51
|
version_requirements: !ruby/object:Gem::Requirement
|
53
52
|
requirements:
|
54
53
|
- - "~>"
|
55
54
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
55
|
+
version: 7.3.0
|
57
56
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
57
|
+
name: activesupport
|
59
58
|
requirement: !ruby/object:Gem::Requirement
|
60
59
|
requirements:
|
61
|
-
- - "
|
60
|
+
- - ">="
|
62
61
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
62
|
+
version: 7.1.0
|
64
63
|
type: :runtime
|
65
64
|
prerelease: false
|
66
65
|
version_requirements: !ruby/object:Gem::Requirement
|
67
66
|
requirements:
|
68
|
-
- - "
|
67
|
+
- - ">="
|
69
68
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
69
|
+
version: 7.1.0
|
71
70
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
71
|
+
name: thor
|
73
72
|
requirement: !ruby/object:Gem::Requirement
|
74
73
|
requirements:
|
75
74
|
- - "~>"
|
76
75
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
76
|
+
version: 1.3.0
|
78
77
|
type: :runtime
|
79
78
|
prerelease: false
|
80
79
|
version_requirements: !ruby/object:Gem::Requirement
|
81
80
|
requirements:
|
82
81
|
- - "~>"
|
83
82
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
83
|
+
version: 1.3.0
|
85
84
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
85
|
+
name: mocha
|
87
86
|
requirement: !ruby/object:Gem::Requirement
|
88
87
|
requirements:
|
89
|
-
- - "
|
88
|
+
- - "~>"
|
90
89
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
-
type: :
|
90
|
+
version: 2.7.0
|
91
|
+
type: :development
|
93
92
|
prerelease: false
|
94
93
|
version_requirements: !ruby/object:Gem::Requirement
|
95
94
|
requirements:
|
96
|
-
- - "
|
95
|
+
- - "~>"
|
97
96
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
97
|
+
version: 2.7.0
|
99
98
|
- !ruby/object:Gem::Dependency
|
100
|
-
name:
|
99
|
+
name: rake
|
101
100
|
requirement: !ruby/object:Gem::Requirement
|
102
101
|
requirements:
|
103
|
-
- - "
|
102
|
+
- - "~>"
|
104
103
|
- !ruby/object:Gem::Version
|
105
|
-
version:
|
106
|
-
type: :
|
104
|
+
version: 13.2.0
|
105
|
+
type: :development
|
107
106
|
prerelease: false
|
108
107
|
version_requirements: !ruby/object:Gem::Requirement
|
109
108
|
requirements:
|
110
|
-
- - "
|
109
|
+
- - "~>"
|
111
110
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
111
|
+
version: 13.2.0
|
113
112
|
- !ruby/object:Gem::Dependency
|
114
113
|
name: rspec
|
115
114
|
requirement: !ruby/object:Gem::Requirement
|
116
115
|
requirements:
|
117
116
|
- - "~>"
|
118
117
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
120
|
-
type: :
|
118
|
+
version: 3.13.0
|
119
|
+
type: :development
|
121
120
|
prerelease: false
|
122
121
|
version_requirements: !ruby/object:Gem::Requirement
|
123
122
|
requirements:
|
124
123
|
- - "~>"
|
125
124
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
125
|
+
version: 3.13.0
|
127
126
|
description: Taza is an opinionated page object framework.
|
128
127
|
email:
|
129
128
|
- watir-general@googlegroups.com
|
@@ -201,7 +200,6 @@ files:
|
|
201
200
|
homepage: http://github.com/hammernight/taza
|
202
201
|
licenses: []
|
203
202
|
metadata: {}
|
204
|
-
post_install_message:
|
205
203
|
rdoc_options: []
|
206
204
|
require_paths:
|
207
205
|
- lib
|
@@ -209,16 +207,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
207
|
requirements:
|
210
208
|
- - ">="
|
211
209
|
- !ruby/object:Gem::Version
|
212
|
-
version:
|
210
|
+
version: 3.0.0
|
213
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
212
|
requirements:
|
215
213
|
- - ">="
|
216
214
|
- !ruby/object:Gem::Version
|
217
215
|
version: '0'
|
218
216
|
requirements: []
|
219
|
-
|
220
|
-
rubygems_version: 2.6.14
|
221
|
-
signing_key:
|
217
|
+
rubygems_version: 3.6.2
|
222
218
|
specification_version: 4
|
223
219
|
summary: Taza is an opinionated page object framework.
|
224
220
|
test_files:
|