taza 0.9.2.1 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/.gitignore +3 -1
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +2 -1
- data/Gemfile +1 -1
- data/History.txt +4 -0
- data/README.md +6 -1
- data/lib/formatters/failing_examples_formatter.rb +1 -1
- data/lib/taza.rb +0 -1
- data/lib/taza/browser.rb +2 -2
- data/lib/taza/fixture.rb +1 -1
- data/lib/taza/settings.rb +1 -1
- data/lib/taza/site.rb +2 -2
- data/lib/taza/version.rb +1 -1
- data/spec/generators/flow_generator_spec.rb +1 -1
- data/spec/generators/page_generator_spec.rb +3 -3
- data/spec/generators/partial_generator_spec.rb +1 -1
- data/spec/generators/project_generator_spec.rb +13 -13
- data/spec/generators/site_generator_spec.rb +9 -9
- data/spec/generators/taza_bin_spec.rb +6 -10
- data/spec/platform/windows/browser_win.rb +17 -18
- data/spec/spec_helper.rb +1 -1
- data/spec/taza/array_spec.rb +4 -4
- data/spec/taza/browser_spec.rb +4 -4
- data/spec/taza/entity_spec.rb +6 -6
- data/spec/taza/fixture_spec.rb +9 -9
- data/spec/taza/fixtures_spec.rb +10 -10
- data/spec/taza/hash_spec.rb +2 -2
- data/spec/taza/page_module_spec.rb +32 -24
- data/spec/taza/page_spec.rb +16 -16
- data/spec/taza/settings_spec.rb +13 -13
- data/spec/taza/site_fixtures_spec.rb +2 -2
- data/spec/taza/site_spec.rb +62 -67
- data/spec/taza/string_spec.rb +2 -2
- data/taza.gemspec +4 -3
- metadata +53 -39
- data/.rvmrc +0 -49
- data/lib/taza.rb.backup +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MDI3NTkxMjllMTFkYmUzMTdkMTJmZDJjMmFjN2M1OTM5N2YyYTc2Yw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2I1MTU0ZmM1NjY4OWJjOWQ4YzExZTYwOGVkMDI2MGZmMzhiYjZjZg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NmIwNzQwMWE0ZDg1ZGIxMmI2ZjdiNGIxMzNjNDgzZGM5OTY2YTgzODQxN2Y0
|
10
|
+
NjAyNWM4Nzc4YTYxODczZDQ0OWY3OGYxYTU3OGRkZDZlNTBkM2YyOTA1MGUx
|
11
|
+
NDU2YTUxODk4ZDgzYmI3OTg4ZjE0NTY5MWFmOWQ5OWNiMmQ1ZGU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MGZmNzdiYTg4ZTk1ZWZjZTIyMjkxODEwYTU3NjA0MDRmNWJjYmNhMzFmODM2
|
14
|
+
NDBhODJhMTNjNjA4OGYwYTE1MTk3ZjY3NTU2Y2FlNDdlMzRiODg5MjU0Y2Yx
|
15
|
+
MTMyN2UxOGYwNzQ1NmY2OWU0ZGNjZDE1OTI3NmQzNTMzYzEyMWQ=
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
taza
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#taza
|
2
|
+
## Build Status
|
3
|
+
###### Master
|
4
|
+
[![Build Status](https://travis-ci.org/hammernight/taza.svg?branch=master)](https://travis-ci.org/hammernight/taza) [![Code Climate](https://codeclimate.com/github/hammernight/taza.png)](https://codeclimate.com/github/hammernight/taza) [![Build Status](https://snap-ci.com/hammernight/taza/branch/master/build_image)](https://snap-ci.com/hammernight/taza/branch/master)
|
5
|
+
|
6
|
+
###### Branches
|
2
7
|
[![Build Status](https://secure.travis-ci.org/hammernight/taza.png)](http://travis-ci.org/hammernight/taza)
|
3
|
-
|
8
|
+
|
4
9
|
|
5
10
|
* https://github.com/hammernight/taza
|
6
11
|
* Wiki: http://github.com/scudco/taza/wikis
|
data/lib/taza.rb
CHANGED
data/lib/taza/browser.rb
CHANGED
data/lib/taza/fixture.rb
CHANGED
@@ -27,7 +27,7 @@ module Taza
|
|
27
27
|
Dir.glob(File.join(dir,'*.yml')) do |file|
|
28
28
|
templatized_fixture=ERB.new(File.read(file))
|
29
29
|
entitized_fixture = {}
|
30
|
-
YAML.load(templatized_fixture.result
|
30
|
+
YAML.load(templatized_fixture.result).each do |key, value|
|
31
31
|
entitized_fixture[key] = value.convert_hash_keys_to_methods(self)
|
32
32
|
end
|
33
33
|
@fixtures[File.basename(file,'.yml').to_sym] = entitized_fixture
|
data/lib/taza/settings.rb
CHANGED
@@ -23,7 +23,7 @@ module Taza
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.site_file(site_name) # :nodoc:
|
26
|
-
YAML.
|
26
|
+
YAML.load(ERB.new(File.read(File.join(config_folder,"#{site_name.underscore}.yml"))).result)[ENV['TAZA_ENV']]
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.path # :nodoc:
|
data/lib/taza/site.rb
CHANGED
@@ -15,7 +15,7 @@ module Taza
|
|
15
15
|
#
|
16
16
|
# end
|
17
17
|
class Site
|
18
|
-
@@before_browser_closes = Proc.new
|
18
|
+
@@before_browser_closes = Proc.new {}
|
19
19
|
@@donot_close_browser = false
|
20
20
|
# Use this to do something with the browser before it closes, but note that it is a class method which
|
21
21
|
# means that this will get called for any instance of a site.
|
@@ -134,7 +134,7 @@ module Taza
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def flows_path # :nodoc:
|
137
|
-
File.join(path,'flows','*.rb')
|
137
|
+
File.join(path,'flows','**','*.rb')
|
138
138
|
end
|
139
139
|
|
140
140
|
def path # :nodoc:
|
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.exists?('lib/sites/foo_site/flows/checkout.rb')).to
|
17
|
+
expect(File.exists?('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.exists?('lib/sites/foo_site/pages/home_page.rb')).to
|
18
|
+
expect(File.exists?('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.exists?('spec/isolation/home_page_spec.rb')).to
|
22
|
+
expect(File.exists?('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
|
@@ -30,7 +30,7 @@ describe Taza::PageGenerator do
|
|
30
30
|
it 'generates a page that can be required' do
|
31
31
|
output
|
32
32
|
page_spec = 'spec/isolation/home_page_spec.rb'
|
33
|
-
expect(system("ruby -c #{page_spec} > #{null_device}")).to
|
33
|
+
expect(system("ruby -c #{page_spec} > #{null_device}")).to be true
|
34
34
|
end
|
35
35
|
|
36
36
|
xit "should be able to access the generated page from the site" 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.exists?('lib/sites/foo_site/pages/partials/navigation.rb')).to
|
17
|
+
expect(File.exists?('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,67 +9,67 @@ describe Taza::ProjectGenerator do
|
|
9
9
|
|
10
10
|
it 'a Gemfile' do
|
11
11
|
expect(output).to include("Gemfile")
|
12
|
-
expect(File.exists?('Gemfile')).to
|
12
|
+
expect(File.exists?('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.exists?('Rakefile')).to
|
17
|
+
expect(File.exists?('Rakefile')).to be true
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'the Rakefile can be required' do
|
21
21
|
output
|
22
|
-
system("ruby -c Rakefile > #{null_device}").
|
22
|
+
expect(system("ruby -c Rakefile > #{null_device}")).to be true
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'config/config.yml' do
|
26
26
|
expect(output).to include('config/config.yml')
|
27
|
-
expect(File.exists?('config/config.yml')).to
|
27
|
+
expect(File.exists?('config/config.yml')).to be true
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'lib/sites' do
|
31
31
|
expect(output).to include('lib/sites')
|
32
|
-
expect(File.directory?('lib/sites')).to
|
32
|
+
expect(File.directory?('lib/sites')).to be true
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'a spec_helper.rb' do
|
36
36
|
expect(output).to include('spec/spec_helper.rb')
|
37
|
-
expect(File.exists?('spec/spec_helper.rb')).to
|
37
|
+
expect(File.exists?('spec/spec_helper.rb')).to be true
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'spec_helper.rb can be required' do
|
41
41
|
output
|
42
|
-
system("ruby -c spec/spec_helper.rb > #{null_device}").
|
42
|
+
expect(system("ruby -c spec/spec_helper.rb > #{null_device}")).to be true
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'spec/isolation' do
|
46
46
|
expect(output).to include('spec/isolation')
|
47
|
-
expect(File.directory?('spec/isolation')).to
|
47
|
+
expect(File.directory?('spec/isolation')).to be true
|
48
48
|
end
|
49
49
|
|
50
50
|
it 'spec/integration' do
|
51
51
|
expect(output).to include('spec/integration')
|
52
|
-
expect(File.directory?('spec/integration')).to
|
52
|
+
expect(File.directory?('spec/integration')).to be true
|
53
53
|
end
|
54
54
|
|
55
55
|
it 'bin' do
|
56
56
|
expect(output).to include('bin')
|
57
|
-
expect(File.directory?('bin')).to
|
57
|
+
expect(File.directory?('bin')).to be true
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'the taza executable' do
|
61
61
|
expect(output).to include('spec/spec_helper.rb')
|
62
|
-
expect(File.exists?('spec/spec_helper.rb')).to
|
62
|
+
expect(File.exists?('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
|
-
File.exists?(File.join(APP_ROOT, 'script', 'console')).
|
67
|
+
expect(File.exists?(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
|
-
File.exists?(File.join(APP_ROOT, 'script', 'console.cmd')).
|
72
|
+
expect(File.exists?(File.join(APP_ROOT, 'script', 'console.cmd'))).to be true
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
@@ -9,32 +9,32 @@ 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.exists?('lib/sites/foo_site.rb')).to
|
12
|
+
expect(File.exists?('lib/sites/foo_site.rb')).to be true
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'lib/sites/foo_site' do
|
16
16
|
expect(output).to include('lib/sites/foo_site')
|
17
|
-
expect(File.directory?('lib/sites/foo_site')).to
|
17
|
+
expect(File.directory?('lib/sites/foo_site')).to be true
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'lib/sites/foo_site/flows' do
|
21
21
|
expect(output).to include("lib/sites/foo_site/flows")
|
22
|
-
expect(File.directory?('lib/sites/foo_site/flows')).to
|
22
|
+
expect(File.directory?('lib/sites/foo_site/flows')).to be true
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'lib/sites/foo_site/pages' do
|
26
26
|
expect(output).to include("lib/sites/foo_site/pages")
|
27
|
-
expect(File.directory?('lib/sites/foo_site/pages')).to
|
27
|
+
expect(File.directory?('lib/sites/foo_site/pages')).to be true
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'lib/sites/foo_site/pages/partials' do
|
31
31
|
expect(output).to include("lib/sites/foo_site/pages/partials")
|
32
|
-
expect(File.directory?('lib/sites/foo_site/pages/partials')).to
|
32
|
+
expect(File.directory?('lib/sites/foo_site/pages/partials')).to be true
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'config/foo_site.yml' do
|
36
36
|
expect(output).to include("config/foo_site.yml")
|
37
|
-
expect(File.exists?('config/foo_site.yml')).to
|
37
|
+
expect(File.exists?('config/foo_site.yml')).to be true
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'does not overwrite existing site' do
|
@@ -43,14 +43,14 @@ describe Taza::SiteGenerator do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
it "generates a site that can uses the block given in new" do
|
46
|
-
|
46
|
+
skip 'will have to fix this later'
|
47
47
|
@site_class = generate_site(@site_name)
|
48
48
|
stub_settings
|
49
49
|
stub_browser
|
50
50
|
foo = nil
|
51
51
|
@site_class.new { |site| foo = site }
|
52
|
-
foo.
|
53
|
-
foo.
|
52
|
+
expect(foo).to_not be_nil
|
53
|
+
expect(foo).to be_a_kind_of Taza::Site
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
@@ -2,19 +2,15 @@ require 'spec_helper'
|
|
2
2
|
require 'rubygems'
|
3
3
|
require 'fileutils'
|
4
4
|
|
5
|
-
describe
|
6
|
-
|
7
|
-
|
8
|
-
output = system("taza")
|
9
|
-
expect(output).to be_true
|
10
|
-
|
5
|
+
describe 'Taza bin' do
|
6
|
+
context 'running taza in the terminal' do
|
7
|
+
specify { expect { system('taza') }.to output.to_stdout_from_any_process }
|
11
8
|
end
|
12
9
|
|
13
|
-
it
|
14
|
-
|
10
|
+
it 'should have an executable script' do
|
11
|
+
skip 'Not sure this is really necessary, as this is just testing if command line returns anything. It also breaks JRuby.'
|
15
12
|
path = 'spec/sandbox/generators'
|
16
13
|
taza_bin = "#{File.expand_path(File.dirname(__FILE__)+'/../bin/taza')} #{path}"
|
17
|
-
system("ruby -c #{taza_bin} > #{null_device}").
|
14
|
+
expect(system("ruby -c #{taza_bin} > #{null_device}")).to be true
|
18
15
|
end
|
19
|
-
|
20
16
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative '../../spec_helper'
|
2
2
|
require 'taza/browser'
|
3
3
|
require 'taza/settings'
|
4
4
|
require 'taza/options'
|
@@ -16,32 +16,31 @@ describe Taza::Browser do
|
|
16
16
|
ENV['DRIVER'] = nil
|
17
17
|
ENV['TIMEOUT'] = nil
|
18
18
|
end
|
19
|
+
|
19
20
|
it "should be able to attach to an open IE instance" do
|
20
|
-
require 'watir'
|
21
21
|
browser = Object.new
|
22
|
-
Watir::
|
23
|
-
Watir::
|
24
|
-
old_browser = Watir::
|
25
|
-
new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir, :attach => true)
|
26
|
-
new_browser.
|
22
|
+
Watir::Browser.stubs(:find).returns(browser)
|
23
|
+
Watir::Browser.stubs(:new).returns(browser)
|
24
|
+
old_browser = Watir::Browser.new
|
25
|
+
new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir, :attach => true)
|
26
|
+
expect(new_browser).to eql old_browser
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
it "should be able to open a new IE instance if there is no instance to attach to" do
|
30
|
-
require 'watir'
|
31
30
|
browser = Object.new
|
32
|
-
Watir::
|
33
|
-
Watir::
|
34
|
-
|
35
|
-
browser.
|
31
|
+
Watir::Browser.stubs(:find).returns(stub_everything)
|
32
|
+
Watir::Browser.stubs(:new).returns(browser)
|
33
|
+
Taza::Browser.create(:browser => :ie, :driver => :watir)
|
34
|
+
expect(browser).to be_truthy
|
36
35
|
end
|
36
|
+
|
37
37
|
it "should be able to open a new IE instance if attach not specified" do
|
38
|
-
require 'watir'
|
39
38
|
foo = Object.new
|
40
39
|
bar = Object.new
|
41
|
-
Watir::
|
42
|
-
Watir::
|
43
|
-
new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir)
|
44
|
-
new_browser.
|
40
|
+
Watir::Browser.stubs(:find).returns(foo)
|
41
|
+
Watir::Browser.stubs(:new).returns(bar)
|
42
|
+
new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir)
|
43
|
+
expect(new_browser).to_not eql foo
|
45
44
|
end
|
46
45
|
|
47
46
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/taza/array_spec.rb
CHANGED
@@ -3,15 +3,15 @@ require 'extensions/array'
|
|
3
3
|
|
4
4
|
describe 'Array Extensions' do
|
5
5
|
it "should know if elements are not equivalent to a subset of those elements" do
|
6
|
-
[1,2,3].
|
6
|
+
expect([1,2,3]).to_not be_equivalent [2,3]
|
7
7
|
end
|
8
8
|
it "should know if elements are not equivalent to a larger set including those elements" do
|
9
|
-
[1,2,3].
|
9
|
+
expect([1,2,3]).to_not be_equivalent [1,2,3,4]
|
10
10
|
end
|
11
11
|
it "should know it is equivalent if the same order" do
|
12
|
-
[1,2,3].
|
12
|
+
expect([1,2,3]).to be_equivalent [1,2,3]
|
13
13
|
end
|
14
14
|
it "should know it is equivalent if the different orders" do
|
15
|
-
[1,2,3].
|
15
|
+
expect([1,2,3]).to be_equivalent [2,1,3]
|
16
16
|
end
|
17
17
|
end
|
data/spec/taza/browser_spec.rb
CHANGED
@@ -13,11 +13,11 @@ describe Taza::Browser do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should raise unknown browser error for unsupported watir browsers" do
|
16
|
-
lambda { Taza::Browser.create(:browser => :foo_browser_9000,:driver => :watir) }.
|
16
|
+
expect(lambda { 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
22
|
Selenium::SeleniumDriver.expects(:new).with(anything,anything,'*opera',anything)
|
23
23
|
Taza::Browser.create(:browser => browser_type, :driver => :selenium)
|
@@ -39,7 +39,7 @@ describe Taza::Browser do
|
|
39
39
|
|
40
40
|
it "should be able to create a selenium instance" do
|
41
41
|
browser = Taza::Browser.create(:browser => :firefox, :driver => :selenium)
|
42
|
-
browser.
|
42
|
+
expect(browser).to be_a_kind_of Selenium::SeleniumDriver
|
43
43
|
end
|
44
44
|
|
45
45
|
it "should use environment settings for server port and ip" do
|
@@ -61,7 +61,7 @@ describe Taza::Browser do
|
|
61
61
|
|
62
62
|
it "should be able to give you the class of browser" do
|
63
63
|
Taza::Browser.expects(:watir_safari).returns(Object)
|
64
|
-
Taza::Browser.browser_class(:browser => :safari, :driver => :watir).
|
64
|
+
expect(Taza::Browser.browser_class(:browser => :safari, :driver => :watir)).to eql Object
|
65
65
|
end
|
66
66
|
|
67
67
|
end
|