taza 0.5.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +33 -0
- data/Manifest.txt +39 -9
- data/README.txt +29 -7
- data/Rakefile +72 -13
- data/bin/taza +16 -3
- data/generators/flow/flow_generator.rb +57 -0
- data/generators/flow/templates/flow.rb.erb +12 -0
- data/generators/page/page_generator.rb +58 -0
- data/generators/page/templates/functional_page_spec.rb.erb +8 -0
- data/generators/page/templates/page.rb.erb +8 -0
- data/generators/site/site_generator.rb +55 -0
- data/generators/site/templates/site.rb.erb +10 -0
- data/generators/site/templates/site.yml.erb +3 -0
- data/lib/app_generators/taza/taza_generator.rb +76 -0
- data/lib/app_generators/taza/templates/config.yml.erb +3 -0
- data/lib/{taza/generators → app_generators/taza}/templates/rakefile.rb.erb +0 -0
- data/lib/app_generators/taza/templates/spec_helper.rb.erb +11 -0
- data/lib/taza.rb +44 -5
- data/lib/taza/browser.rb +40 -0
- data/lib/taza/browsers/ie_watir.rb +8 -0
- data/lib/taza/browsers/safari_watir.rb +8 -0
- data/lib/taza/flow.rb +45 -0
- data/lib/taza/page.rb +66 -19
- data/lib/taza/settings.rb +36 -0
- data/lib/taza/site.rb +122 -11
- data/lib/taza/tasks.rb +26 -34
- data/spec/browser_spec.rb +72 -0
- data/spec/flow_generator_spec.rb +70 -0
- data/spec/page_generator_spec.rb +57 -0
- data/spec/page_spec.rb +82 -0
- data/spec/platform/osx/browser_spec.rb +14 -0
- data/spec/platform/windows/browser_spec.rb +14 -0
- data/spec/project_generator_spec.rb +42 -0
- data/spec/sandbox/config.yml +3 -0
- data/spec/sandbox/config/config.yml +1 -0
- data/spec/sandbox/config/site_name.yml +5 -0
- data/spec/sandbox/flows/batman.rb +2 -0
- data/spec/sandbox/flows/robin.rb +4 -0
- data/spec/sandbox/pages/foo/bar.rb +9 -0
- data/spec/settings_spec.rb +88 -0
- data/spec/site_generator_spec.rb +53 -0
- data/spec/site_spec.rb +239 -0
- data/spec/spec_helper.rb +49 -0
- data/spec/taza_bin_spec.rb +14 -0
- data/spec/taza_spec.rb +12 -0
- data/spec/taza_tasks_spec.rb +27 -0
- data/spec/unit_helper_spec.rb +14 -0
- metadata +103 -13
- data/lib/taza/generators.rb +0 -4
- data/lib/taza/generators/base.rb +0 -33
- data/lib/taza/generators/page.rb +0 -22
- data/lib/taza/generators/project.rb +0 -18
- data/lib/taza/generators/site.rb +0 -24
- data/lib/taza/generators/templates/page.rb.erb +0 -6
- data/lib/taza/generators/templates/site.rb.erb +0 -6
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
require 'mocha'
|
4
|
+
require 'config/vendorized_gems'
|
5
|
+
lib_path = File.expand_path("#{File.dirname(__FILE__)}/../lib")
|
6
|
+
$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
|
7
|
+
TMP_ROOT = File.join(File.dirname(__FILE__),"sandbox","generated")
|
8
|
+
PROJECT_NAME = 'example'
|
9
|
+
PROJECT_FOLDER = File.join(TMP_ROOT,PROJECT_NAME)
|
10
|
+
|
11
|
+
|
12
|
+
Spec::Runner.configure do |config|
|
13
|
+
config.mock_with :mocha
|
14
|
+
end
|
15
|
+
|
16
|
+
def null_device
|
17
|
+
Taza.windows? ? 'NUL': '/dev/null'
|
18
|
+
end
|
19
|
+
|
20
|
+
def generator_sources
|
21
|
+
[RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..","lib", "app_generators")),
|
22
|
+
RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", "generators"))]
|
23
|
+
end
|
24
|
+
|
25
|
+
module Helpers
|
26
|
+
module Generator
|
27
|
+
def generate_site(site_name)
|
28
|
+
site_name = "#{site_name}#{Time.now.to_i}"
|
29
|
+
run_generator('site', [site_name], generator_sources)
|
30
|
+
site_file_path = File.join(PROJECT_FOLDER,'lib','sites',"#{site_name.underscore}.rb")
|
31
|
+
require site_file_path
|
32
|
+
"::#{site_name.camelize}::#{site_name.camelize}".constantize.any_instance.stubs(:base_path).returns(PROJECT_FOLDER)
|
33
|
+
site_name.camelize.constantize
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Taza
|
38
|
+
def stub_settings
|
39
|
+
::Taza::Settings.stubs(:config).returns({})
|
40
|
+
end
|
41
|
+
|
42
|
+
def stub_browser
|
43
|
+
stub_browser = stub()
|
44
|
+
stub_browser.stubs(:goto)
|
45
|
+
stub_browser.stubs(:close)
|
46
|
+
::Taza::Browser.stubs(:create).returns(stub_browser)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec/spec_helper'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'taza'
|
5
|
+
|
6
|
+
describe "Taza project generator script" do
|
7
|
+
|
8
|
+
it "should have an executable script" do
|
9
|
+
path = 'spec/sandbox/generators'
|
10
|
+
taza_bin = "#{File.expand_path(File.dirname(__FILE__)+'/../bin/taza')} #{path}"
|
11
|
+
system("ruby -c #{taza_bin} > #{null_device}").should be_true
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/spec/taza_spec.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec/spec_helper'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
describe "Taza Tasks" do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@file_name ="./lib/taza/tasks.rb"
|
9
|
+
@rake = Rake::Application.new
|
10
|
+
Rake.application = @rake
|
11
|
+
end
|
12
|
+
|
13
|
+
after :all do
|
14
|
+
Rake.application = nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should create rake spec tasks for all sites" do
|
18
|
+
Dir.expects(:glob).with('./spec/functional/*/').returns(['./spec/functional/foo/'])
|
19
|
+
load @file_name
|
20
|
+
tasks.include?("spec:functional:foo").should be_true
|
21
|
+
end
|
22
|
+
|
23
|
+
def tasks
|
24
|
+
@rake.tasks.collect{|task| task.name }
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec/spec_helper'
|
2
|
+
|
3
|
+
describe 'helper function tests' do
|
4
|
+
|
5
|
+
it 'should return NUL in windows' do
|
6
|
+
Taza.stubs(:windows?).returns true
|
7
|
+
null_device.should eql('NUL')
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should return /dev/null in windows' do
|
11
|
+
Taza.stubs(:windows?).returns false
|
12
|
+
null_device.should eql('/dev/null')
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Anderson
|
@@ -9,9 +9,69 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-24 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: taglob
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.0.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: hoe
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: mocha
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.9.0
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
type: :runtime
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: "0"
|
64
|
+
version:
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rubigen
|
67
|
+
type: :runtime
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
15
75
|
- !ruby/object:Gem::Dependency
|
16
76
|
name: hoe
|
17
77
|
type: :development
|
@@ -20,7 +80,7 @@ dependencies:
|
|
20
80
|
requirements:
|
21
81
|
- - ">="
|
22
82
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
83
|
+
version: 1.8.2
|
24
84
|
version:
|
25
85
|
description: Taza is meant to make acceptance testing more sane for developers(or QA where applicable) and customers.
|
26
86
|
email:
|
@@ -39,18 +99,48 @@ files:
|
|
39
99
|
- README.txt
|
40
100
|
- Rakefile
|
41
101
|
- bin/taza
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
46
|
-
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
-
|
102
|
+
- generators/flow/flow_generator.rb
|
103
|
+
- generators/flow/templates/flow.rb.erb
|
104
|
+
- generators/page/page_generator.rb
|
105
|
+
- generators/page/templates/functional_page_spec.rb.erb
|
106
|
+
- generators/page/templates/page.rb.erb
|
107
|
+
- generators/site/site_generator.rb
|
108
|
+
- generators/site/templates/site.rb.erb
|
109
|
+
- generators/site/templates/site.yml.erb
|
110
|
+
- lib/app_generators/taza/taza_generator.rb
|
111
|
+
- lib/app_generators/taza/templates/config.yml.erb
|
112
|
+
- lib/app_generators/taza/templates/rakefile.rb.erb
|
113
|
+
- lib/app_generators/taza/templates/spec_helper.rb.erb
|
114
|
+
- lib/taza.rb
|
115
|
+
- lib/taza/browser.rb
|
116
|
+
- lib/taza/browsers/ie_watir.rb
|
117
|
+
- lib/taza/browsers/safari_watir.rb
|
118
|
+
- lib/taza/flow.rb
|
50
119
|
- lib/taza/page.rb
|
120
|
+
- lib/taza/settings.rb
|
51
121
|
- lib/taza/site.rb
|
52
122
|
- lib/taza/tasks.rb
|
53
|
-
-
|
123
|
+
- spec/browser_spec.rb
|
124
|
+
- spec/flow_generator_spec.rb
|
125
|
+
- spec/page_generator_spec.rb
|
126
|
+
- spec/page_spec.rb
|
127
|
+
- spec/platform/osx/browser_spec.rb
|
128
|
+
- spec/platform/windows/browser_spec.rb
|
129
|
+
- spec/project_generator_spec.rb
|
130
|
+
- spec/sandbox/config.yml
|
131
|
+
- spec/sandbox/config/config.yml
|
132
|
+
- spec/sandbox/config/site_name.yml
|
133
|
+
- spec/sandbox/flows/batman.rb
|
134
|
+
- spec/sandbox/flows/robin.rb
|
135
|
+
- spec/sandbox/pages/foo/bar.rb
|
136
|
+
- spec/settings_spec.rb
|
137
|
+
- spec/site_generator_spec.rb
|
138
|
+
- spec/site_spec.rb
|
139
|
+
- spec/spec_helper.rb
|
140
|
+
- spec/taza_bin_spec.rb
|
141
|
+
- spec/taza_spec.rb
|
142
|
+
- spec/taza_tasks_spec.rb
|
143
|
+
- spec/unit_helper_spec.rb
|
54
144
|
has_rdoc: true
|
55
145
|
homepage: "http://github.com/scudco/taza/tree/master "
|
56
146
|
post_install_message:
|
@@ -74,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
164
|
requirements: []
|
75
165
|
|
76
166
|
rubyforge_project: taza
|
77
|
-
rubygems_version: 1.
|
167
|
+
rubygems_version: 1.3.0
|
78
168
|
signing_key:
|
79
169
|
specification_version: 2
|
80
170
|
summary: Taza is meant to make acceptance testing more sane for developers(or QA where applicable) and customers.
|
data/lib/taza/generators.rb
DELETED
data/lib/taza/generators/base.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'activesupport'
|
3
|
-
require 'erb'
|
4
|
-
|
5
|
-
module Taza
|
6
|
-
module Generators
|
7
|
-
class Base
|
8
|
-
def file(template_file_name,output_file)
|
9
|
-
write_file(output_file,render_template(template_file_name))
|
10
|
-
end
|
11
|
-
|
12
|
-
def render_template(template_file_name)
|
13
|
-
template = ERB.new(read_template(template_file_name))
|
14
|
-
template.result(binding)
|
15
|
-
end
|
16
|
-
|
17
|
-
def folder(path)
|
18
|
-
underscored_path = Inflector.underscore(path)
|
19
|
-
Dir.mkdir(underscored_path) unless File.directory?(underscored_path)
|
20
|
-
end
|
21
|
-
|
22
|
-
def write_file(output_file,contents)
|
23
|
-
File.open(Inflector.underscore(output_file),"w") do |out|
|
24
|
-
out << contents
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def read_template(template_file_name)
|
29
|
-
File.read(File.join(File.dirname(__FILE__),"templates",template_file_name))
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/taza/generators/page.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'taza/generators/base'
|
2
|
-
|
3
|
-
module Taza
|
4
|
-
module Generators
|
5
|
-
class Page < Base
|
6
|
-
attr_accessor :file_name
|
7
|
-
def initialize(file_name,site_name)
|
8
|
-
@file_name = file_name
|
9
|
-
@site_name = site_name
|
10
|
-
end
|
11
|
-
|
12
|
-
def folder_path
|
13
|
-
File.join('lib','sites')
|
14
|
-
end
|
15
|
-
|
16
|
-
def generate
|
17
|
-
file "page.rb.erb", File.join(folder_path, @site_name, "pages", "#{@file_name}.rb")
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'taza/generators/base'
|
2
|
-
|
3
|
-
module Taza
|
4
|
-
module Generators
|
5
|
-
class Project < Base
|
6
|
-
def initialize(path)
|
7
|
-
@path = path
|
8
|
-
end
|
9
|
-
def generate
|
10
|
-
folder @path
|
11
|
-
file "rakefile.rb.erb", File.join(@path,"rakefile")
|
12
|
-
folder File.join(@path,"lib")
|
13
|
-
folder File.join(@path,"lib","sites")
|
14
|
-
folder File.join(@path,"lib","flows")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
data/lib/taza/generators/site.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'taza/generators/base'
|
2
|
-
|
3
|
-
module Taza
|
4
|
-
module Generators
|
5
|
-
class Site < Base
|
6
|
-
attr_accessor :file_name
|
7
|
-
|
8
|
-
def initialize(file_name)
|
9
|
-
@file_name = file_name
|
10
|
-
end
|
11
|
-
|
12
|
-
def folder_path
|
13
|
-
File.join('lib','sites')
|
14
|
-
end
|
15
|
-
|
16
|
-
def generate
|
17
|
-
file "site.rb.erb", File.join(folder_path,"#{file_name}.rb")
|
18
|
-
folder File.join(folder_path,"#{file_name}")
|
19
|
-
folder File.join(folder_path,"#{file_name}","flows")
|
20
|
-
folder File.join(folder_path,"#{file_name}","pages")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|