taza 0.8.0 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/History.txt +7 -0
  2. data/Manifest.txt +14 -0
  3. data/{README.txt → README} +0 -0
  4. data/README.textile +1 -0
  5. data/VERSION.yml +4 -0
  6. data/generators/flow/templates/flow.rb.erb +2 -5
  7. data/generators/page/templates/functional_page_spec.rb.erb +1 -1
  8. data/generators/partial/partial_generator.rb +57 -0
  9. data/generators/partial/templates/partial.rb.erb +7 -0
  10. data/generators/site/site_generator.rb +1 -0
  11. data/lib/app_generators/taza/taza_generator.rb +12 -16
  12. data/lib/app_generators/taza/templates/rakefile.rb.erb +7 -0
  13. data/lib/extensions/array.rb +10 -0
  14. data/lib/extensions/hash.rb +5 -0
  15. data/lib/extensions/object.rb +24 -0
  16. data/lib/extensions/string.rb +11 -0
  17. data/lib/taza.rb +7 -24
  18. data/lib/taza/browser.rb +9 -16
  19. data/lib/taza/entity.rb +34 -0
  20. data/lib/taza/fixture.rb +66 -0
  21. data/lib/taza/flow.rb +10 -15
  22. data/lib/taza/page.rb +13 -8
  23. data/lib/taza/settings.rb +17 -6
  24. data/lib/taza/site.rb +25 -19
  25. data/lib/taza/tasks.rb +42 -26
  26. data/spec/array_spec.rb +16 -0
  27. data/spec/browser_spec.rb +14 -28
  28. data/spec/entity_spec.rb +9 -0
  29. data/spec/fixture_spec.rb +34 -0
  30. data/spec/fixtures_spec.rb +21 -0
  31. data/spec/flow_generator_spec.rb +0 -20
  32. data/spec/hash_spec.rb +12 -0
  33. data/spec/object_spec.rb +29 -0
  34. data/spec/page_generator_spec.rb +0 -1
  35. data/spec/page_spec.rb +14 -0
  36. data/spec/partial_generator_spec.rb +38 -0
  37. data/spec/project_generator_spec.rb +6 -1
  38. data/spec/sandbox/fixtures/examples.yml +8 -0
  39. data/spec/sandbox/fixtures/users.yml +2 -0
  40. data/spec/sandbox/flows/batman.rb +4 -1
  41. data/spec/sandbox/pages/foo/partials/partial_the_reckoning.rb +2 -0
  42. data/spec/settings_spec.rb +5 -5
  43. data/spec/site_generator_spec.rb +5 -1
  44. data/spec/site_spec.rb +19 -29
  45. data/spec/spec_helper.rb +12 -4
  46. data/spec/string_spec.rb +7 -0
  47. data/spec/taza_tasks_spec.rb +17 -1
  48. metadata +59 -45
  49. data/Rakefile +0 -125
  50. data/lib/taza/browsers/ie_watir.rb +0 -8
  51. data/lib/taza/browsers/safari_watir.rb +0 -8
  52. data/spec/platform/osx/browser_spec.rb +0 -14
  53. data/spec/platform/windows/browser_spec.rb +0 -14
  54. data/spec/unit_helper_spec.rb +0 -14
data/Rakefile DELETED
@@ -1,125 +0,0 @@
1
- # -*- ruby -*-
2
- $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
3
-
4
- require 'rubygems'
5
- require 'config/vendorized_gems'
6
- require 'hoe'
7
- require 'taza'
8
- require 'rbconfig'
9
- require 'spec/rake/spectask'
10
- require 'spec/rake/verify_rcov'
11
- require 'rake/rdoctask'
12
-
13
- private
14
- def spec_files
15
- return FileList['spec/**/*_spec.rb'].exclude(/spec\/platform\/(?!osx)/) if Taza.osx?
16
- return FileList['spec/**/*_spec.rb'].exclude(/spec\/platform\/(?!windows)/) if Taza.windows?
17
- return FileList['spec/**/*_spec.rb'].exclude('spec/platform/*')
18
- end
19
- public
20
-
21
- Hoe.new('taza', Taza::VERSION) do |p|
22
- p.rubyforge_name = 'taza' # if different than lowercase project name
23
- p.developer('Adam Anderson', 'adamandersonis@gmail.com')
24
- p.remote_rdoc_dir = ''
25
- p.extra_deps << ['taglob','>= 1.0.0']
26
- p.extra_deps << ['rake']
27
- p.extra_deps << ['hoe']
28
- p.extra_deps << ['mocha','>= 0.9.0']
29
- p.extra_deps << ['rspec']
30
- p.extra_deps << ['rubigen']
31
- end
32
-
33
- Rake::RDocTask.new do |rdoc|
34
- files = ['README.txt', 'History.txt',
35
- 'lib/**/*.rb', 'doc/**/*.rdoc']
36
- rdoc.rdoc_files.add(files)
37
- rdoc.main = 'README.txt'
38
- rdoc.title = 'Taza RDoc'
39
- rdoc.template = './vendor/gems/gems/allison-2.0.3/lib/allison.rb'
40
- rdoc.rdoc_dir = 'doc'
41
- rdoc.options << '--line-numbers' << '--inline-source'
42
- end
43
-
44
- Spec::Rake::SpecTask.new do |t|
45
- t.libs << File.join(File.dirname(__FILE__), 'lib')
46
- t.spec_files = spec_files
47
- end
48
-
49
- desc "Run all examples with RCov"
50
- Spec::Rake::SpecTask.new('rcov') do |t|
51
- t.spec_files = spec_files
52
- t.libs << File.join(File.dirname(__FILE__), 'lib')
53
- t.rcov = true
54
- t.rcov_dir = 'artifacts'
55
- if Taza.windows?
56
- t.rcov_opts = ['--exclude', 'spec,lib/taza/browsers/ie_watir.rb']
57
- elsif Taza.osx?
58
- t.rcov_opts = ['--exclude', 'spec,lib/taza/browsers/safari_watir.rb']
59
- else
60
- t.rcov_opts = ['--exclude', 'spec,lib/taza/browsers']
61
- end
62
- end
63
-
64
- desc "Generate html reports for specs"
65
- Spec::Rake::SpecTask.new(:reports) do |t|
66
- t.spec_files=FileList['spec/**/*_spec.rb']
67
- FileUtils.mkdir('artifacts') unless File.directory?('artifacts')
68
- t.spec_opts=["--format html:artifacts/rspec.html"]
69
- end
70
-
71
- desc "Verify Code Coverage is at 99.4%"
72
- RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
73
- t.threshold = 99.6
74
- t.index_html = 'artifacts/index.html'
75
- end
76
-
77
- desc "Run flog against all the files in the lib"
78
- task :flog do
79
- require "flog"
80
- flogger = Flog.new
81
- flogger.flog_files Dir["lib/**/*.rb"]
82
- FileUtils.mkdir('artifacts') unless File.directory?('artifacts')
83
- File.open("artifacts/flogreport.txt","w") do |file|
84
- flogger.report file
85
- end
86
- end
87
-
88
- desc "Verify Flog Score is under threshold"
89
- task :verify_flog => :flog do |t|
90
- flog_score_threshold = 40.0
91
- messages = []
92
- File.readlines("artifacts/flogreport.txt").each do |line|
93
- line =~ /^(.*): \((\d+\.\d+)\)/
94
- if $2.to_f > flog_score_threshold
95
- messages << "Flog score is too high for #{$1}(#{$2})"
96
- end
97
- end
98
- unless messages.empty?
99
- puts messages
100
- raise "Your Flog score is too high and you ought to think about the children who will have to maintain your code."
101
- end
102
- end
103
-
104
- desc "Run saikuro cyclo complexity against the lib"
105
- task :saikuro do
106
- #we can specify options like ignore filters and set warning or error thresholds
107
- system "ruby vendor/gems/gems/Saikuro-1.1.0/bin/saikuro -c -t -i lib -y 0 -o artifacts"
108
- end
109
-
110
- namespace :gem do
111
- desc "install a gem into vendor/gems"
112
- task :install do
113
- if ENV["name"].nil?
114
- STDERR.puts "Usage: rake gem:install name=the_gem_name"; exit 1
115
- end
116
- gem = Taza.windows? ? "gem.bat" : "gem"
117
- system "#{gem} install #{ENV['name']} --install-dir=vendor/gems --no-rdoc --no-ri -p ""http://10.8.77.100:8080"""
118
- end
119
- end
120
-
121
- desc "Should you check-in?"
122
- task :quick_build => [:verify_rcov, :verify_flog]
123
-
124
- #define a task which uses flog
125
- # vim: syntax=ruby
@@ -1,8 +0,0 @@
1
- module Taza
2
- class Browser
3
- def self.create_watir_ie
4
- require 'watir'
5
- Watir::IE.new
6
- end
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- module Taza
2
- class Browser
3
- def self.create_watir_safari
4
- require 'safariwatir'
5
- Watir::Safari.new
6
- end
7
- end
8
- end
@@ -1,14 +0,0 @@
1
- require 'spec/spec_helper'
2
- require 'taza/browser'
3
-
4
- describe "Taza::Browser with Safari Watir" do
5
- it "should be able to make a safari watir instance" do
6
- browser = nil
7
- begin
8
- browser = Taza::Browser.create({:browser => :safari, :driver => :watir,:url =>'http://www.google.com'})
9
- browser.should be_a_kind_of(Watir::Safari)
10
- ensure
11
- browser.close if browser.is_a?(Watir::Safari)
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require 'spec/spec_helper'
2
- require 'taza/browser'
3
-
4
- describe "Taza::Browser with watir ie" do
5
- it "should be able to make watir ie instance" do
6
- browser = nil
7
- begin
8
- browser = Taza::Browser.create({:browser => :ie,:driver =>:watir,:url => 'http://www.google.com'})
9
- browser.should be_a_kind_of(Watir::IE)
10
- ensure
11
- browser.close if browser.respond_to?(:close)
12
- end
13
- end
14
- end
@@ -1,14 +0,0 @@
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