taza 2.1.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 +8 -0
- data/README.md +4 -4
- data/lib/taza/browser.rb +1 -29
- data/lib/taza/entity.rb +1 -2
- data/lib/taza/fixture.rb +1 -2
- data/lib/taza/generators/project_generator.rb +5 -5
- data/lib/taza/page.rb +3 -5
- data/lib/taza/site.rb +6 -2
- data/lib/taza/version.rb +1 -1
- data/lib/taza.rb +0 -4
- data/spec/generators/flow_generator_spec.rb +4 -4
- data/spec/generators/page_generator_spec.rb +5 -5
- data/spec/generators/partial_generator_spec.rb +4 -4
- data/spec/generators/project_generator_spec.rb +8 -8
- data/spec/generators/site_generator_spec.rb +4 -4
- data/spec/spec_helper.rb +7 -9
- data/spec/taza/browser_spec.rb +9 -9
- data/spec/taza/fixture_spec.rb +1 -2
- 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 +36 -92
- data/.gitignore +0 -6
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.travis.yml +0 -39
- data/Gemfile +0 -3
- data/Gemfile.activesupport-3.2 +0 -5
- data/Gemfile.activesupport-4.0 +0 -5
- data/Gemfile.activesupport-4.1 +0 -5
- data/Gemfile.activesupport-4.2 +0 -5
- data/Gemfile.activesupport-5.0 +0 -5
- data/Manifest.txt +0 -61
- data/Rakefile +0 -5
- data/TODO +0 -22
- data/lib/extensions/array.rb +0 -10
- data/lib/extensions/hash.rb +0 -15
- data/lib/extensions/object.rb +0 -6
- data/lib/extensions/string.rb +0 -22
- data/spec/taza/array_spec.rb +0 -17
- data/spec/taza/hash_spec.rb +0 -15
- data/spec/taza/string_spec.rb +0 -12
- data/taza.gemspec +0 -31
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
@@ -1,6 +1,14 @@
|
|
1
1
|
=== master
|
2
2
|
|
3
|
+
* Do not require users to use Rake, RSpec, or Mocha
|
4
|
+
|
5
|
+
== 3.0.0
|
3
6
|
* Run builds against more versions of Ruby and ActiveSupport
|
7
|
+
* Increase the ActiveSupport dependency to 4.0.2+
|
8
|
+
* Replace firewatir and watir-webdriver with watir
|
9
|
+
* Drop support for Ruby 1.9.3
|
10
|
+
* Add support for Ruby 2.4 and 2.5
|
11
|
+
|
4
12
|
|
5
13
|
=== 1.0
|
6
14
|
updated to RSpec 3 (thanks @drewboardman)
|
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
|
@@ -44,9 +45,8 @@ Here's an example for starting a project around Google apps:
|
|
44
45
|
|
45
46
|
```
|
46
47
|
$ taza create google
|
47
|
-
$ cd google/
|
48
48
|
$ taza site google
|
49
|
-
$ taza page
|
49
|
+
$ taza page home google
|
50
50
|
$ taza flow search google
|
51
51
|
$ rake spec:isolation:google
|
52
52
|
```
|
data/lib/taza/browser.rb
CHANGED
@@ -17,14 +17,7 @@ module Taza
|
|
17
17
|
private
|
18
18
|
|
19
19
|
def self.create_watir(params)
|
20
|
-
|
21
|
-
raise BrowserUnsupportedError unless self.respond_to?(method)
|
22
|
-
watir = self.send(method,params)
|
23
|
-
watir
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.create_watir_webdriver(params)
|
27
|
-
require 'watir-webdriver'
|
20
|
+
require 'watir'
|
28
21
|
Watir::Browser.new(params[:browser])
|
29
22
|
end
|
30
23
|
|
@@ -43,27 +36,6 @@ module Taza
|
|
43
36
|
end
|
44
37
|
Selenium::WebDriver.for params[:browser].to_sym
|
45
38
|
end
|
46
|
-
|
47
|
-
def self.watir_firefox(params)
|
48
|
-
require 'firewatir'
|
49
|
-
FireWatir::Firefox.new
|
50
|
-
end
|
51
|
-
|
52
|
-
def self.watir_safari(params)
|
53
|
-
require 'safariwatir'
|
54
|
-
Watir::Safari.new
|
55
|
-
end
|
56
|
-
|
57
|
-
def self.watir_ie(params)
|
58
|
-
require 'watir'
|
59
|
-
if params[:attach]
|
60
|
-
browser = Watir::Browser.find(:title, //)
|
61
|
-
end
|
62
|
-
browser || Watir::Browser.new
|
63
|
-
end
|
64
39
|
end
|
65
|
-
|
66
|
-
# We don't know how to create the browser you asked for
|
67
|
-
class BrowserUnsupportedError < StandardError; end
|
68
40
|
end
|
69
41
|
|
data/lib/taza/entity.rb
CHANGED
data/lib/taza/fixture.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'find'
|
2
2
|
require 'erb'
|
3
|
-
require 'extensions/hash'
|
4
3
|
require 'taza/entity'
|
5
4
|
|
6
5
|
module Taza
|
@@ -28,7 +27,7 @@ module Taza
|
|
28
27
|
templatized_fixture=ERB.new(File.read(file))
|
29
28
|
entitized_fixture = {}
|
30
29
|
YAML.load(templatized_fixture.result).each do |key, value|
|
31
|
-
entitized_fixture[key] =
|
30
|
+
entitized_fixture[key] = Taza::Entity.new(value, self)
|
32
31
|
end
|
33
32
|
@fixtures[File.basename(file,'.yml').to_sym] = entitized_fixture
|
34
33
|
end
|
@@ -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/page.rb
CHANGED
@@ -109,11 +109,9 @@ module Taza
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def add_element_method(params) # :nodoc:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
self.instance_exec(*args,¶ms[:element_block])
|
116
|
-
end
|
112
|
+
define_singleton_method(params[:element_name]) do |*args|
|
113
|
+
check_filters(params)
|
114
|
+
self.instance_exec(*args, ¶ms[:element_block])
|
117
115
|
end
|
118
116
|
end
|
119
117
|
|
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
data/lib/taza.rb
CHANGED
@@ -7,10 +7,6 @@ require 'taza/settings'
|
|
7
7
|
require 'taza/flow'
|
8
8
|
require 'taza/entity'
|
9
9
|
require 'taza/fixtures'
|
10
|
-
require 'extensions/object'
|
11
|
-
require 'extensions/string'
|
12
|
-
require 'extensions/hash'
|
13
|
-
require 'extensions/array'
|
14
10
|
require 'formatters/failing_examples_formatter'
|
15
11
|
|
16
12
|
#generators
|
@@ -3,22 +3,22 @@ require 'spec_helper'
|
|
3
3
|
describe Taza::FlowGenerator do
|
4
4
|
|
5
5
|
before(:each) do
|
6
|
-
|
6
|
+
capture_stdout { Taza::SiteGenerator.new(['foo_site']).site }
|
7
7
|
end
|
8
8
|
|
9
9
|
context "taza flow checkout foo_site" do
|
10
10
|
context "creates" do
|
11
11
|
|
12
12
|
let(:subject) { Taza::FlowGenerator.new(['checkout', 'foo_site']) }
|
13
|
-
let(:output) {
|
13
|
+
let(:output) { capture_stdout { subject.flow } }
|
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
|
21
|
-
bar_page =
|
21
|
+
bar_page = capture_stdout { Taza::FlowGenerator.new(['checkout', 'bar_site']).flow }
|
22
22
|
expect(bar_page).to include("No such site bar_site exists")
|
23
23
|
end
|
24
24
|
end
|
@@ -4,26 +4,26 @@ describe Taza::PageGenerator do
|
|
4
4
|
include Helpers::Taza
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
|
7
|
+
capture_stdout { Taza::SiteGenerator.new(['foo_site']).site }
|
8
8
|
end
|
9
9
|
|
10
10
|
context "taza page home foo_site" do
|
11
11
|
context "creates" do
|
12
12
|
|
13
13
|
let(:subject) { Taza::PageGenerator.new(['home', 'foo_site']) }
|
14
|
-
let(:output) {
|
14
|
+
let(:output) { capture_stdout { subject.page }}
|
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
|
26
|
-
bar_page =
|
26
|
+
bar_page = capture_stdout { Taza::PageGenerator.new(['checkout', 'bar_site']).page }
|
27
27
|
expect(bar_page).to include("No such site bar_site exists")
|
28
28
|
end
|
29
29
|
|
@@ -3,22 +3,22 @@ require 'spec_helper'
|
|
3
3
|
describe Taza::PartialGenerator do
|
4
4
|
|
5
5
|
before(:each) do
|
6
|
-
|
6
|
+
capture_stdout { Taza::SiteGenerator.new(['foo_site']).site }
|
7
7
|
end
|
8
8
|
|
9
9
|
context "taza partial navigation foo_site" do
|
10
10
|
context "creates" do
|
11
11
|
|
12
12
|
let(:subject) { Taza::PartialGenerator.new(['navigation', 'foo_site']) }
|
13
|
-
let(:output) {
|
13
|
+
let(:output) { capture_stdout { subject.partial } }
|
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
|
21
|
-
bar_page =
|
21
|
+
bar_page = capture_stdout { Taza::PartialGenerator.new(['navigation', 'bar_site']).partial }
|
22
22
|
expect(bar_page).to include("No such site bar_site exists")
|
23
23
|
end
|
24
24
|
end
|
@@ -5,16 +5,16 @@ describe Taza::ProjectGenerator do
|
|
5
5
|
context "creates" do
|
6
6
|
|
7
7
|
let(:subject) { Taza::ProjectGenerator.new(['foo_site']) }
|
8
|
-
let(:output) {
|
8
|
+
let(:output) { capture_stdout { subject.create } }
|
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
|
@@ -5,11 +5,11 @@ describe Taza::SiteGenerator do
|
|
5
5
|
context "creates" do
|
6
6
|
|
7
7
|
let(:subject) { Taza::SiteGenerator.new(['foo_site']) }
|
8
|
-
let(:output) {
|
8
|
+
let(:output) { capture_stdout { subject.site } }
|
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,11 +34,11 @@ 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
|
41
|
-
|
41
|
+
capture_stdout { Taza::SiteGenerator.new(['foo_site']).site }
|
42
42
|
expect(output).to include(*["identical", "exist"])
|
43
43
|
end
|
44
44
|
|
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
|
@@ -22,21 +21,20 @@ RSpec.configure do |config|
|
|
22
21
|
FileUtils.rmtree(@directory)
|
23
22
|
end
|
24
23
|
|
25
|
-
def
|
24
|
+
def capture_stdout
|
26
25
|
begin
|
27
|
-
|
28
|
-
eval "$#{stream} = StringIO.new"
|
26
|
+
$stdout = StringIO.new
|
29
27
|
yield
|
30
|
-
|
28
|
+
out = $stdout.string
|
31
29
|
ensure
|
32
|
-
|
30
|
+
$stdout = STDOUT
|
33
31
|
end
|
34
|
-
|
32
|
+
out
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
38
36
|
def null_device
|
39
|
-
File.
|
37
|
+
File.exist?('/dev/null') ? '/dev/null' : 'NUL'
|
40
38
|
end
|
41
39
|
|
42
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
|
|
@@ -29,7 +29,7 @@ describe Taza::Browser do
|
|
29
29
|
|
30
30
|
it "should use params browser type when creating an watir webdriver instance" do
|
31
31
|
Watir::Browser.expects(:new).with(:firefox)
|
32
|
-
browser = Taza::Browser.create(:browser => :firefox, :driver => :
|
32
|
+
browser = Taza::Browser.create(:browser => :firefox, :driver => :watir)
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should use params browser type when creating a selenium webdriver instance' do
|
@@ -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/fixture_spec.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'taza/fixture'
|
3
|
-
require 'extensions/array'
|
4
3
|
|
5
4
|
describe Taza::Fixture do
|
6
5
|
before :each do
|
@@ -30,7 +29,7 @@ describe Taza::Fixture do
|
|
30
29
|
it "should be able to get all fixtures loaded excluding sub-folder fixtures" do
|
31
30
|
fixture = Taza::Fixture.new
|
32
31
|
fixture.load_fixtures_from(@base_path)
|
33
|
-
expect(fixture.fixture_names).to
|
32
|
+
expect(fixture.fixture_names).to contain_exactly(:examples, :users, :foos)
|
34
33
|
end
|
35
34
|
|
36
35
|
it "should be able to get specific fixture entities" do
|
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
|