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 CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1eff424ac45cbf590db7dfa0d2aef5f5c7ccd55e
4
- data.tar.gz: 8b9def534a0d587b7b567ce46876f3d183cd5554
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MDI3NTkxMjllMTFkYmUzMTdkMTJmZDJjMmFjN2M1OTM5N2YyYTc2Yw==
5
+ data.tar.gz: !binary |-
6
+ Y2I1MTU0ZmM1NjY4OWJjOWQ4YzExZTYwOGVkMDI2MGZmMzhiYjZjZg==
5
7
  SHA512:
6
- metadata.gz: cb6aef03458885f140f85fce63e2a6991c5e5665c767c58579688e77da7e55cdedaec86e447db953b755b46b5e43163d1e060673cf219aacdd7e20d763e6d34b
7
- data.tar.gz: 40ee6a0305731a40af4644224b42685bca7b57df0c2b33afca72c56f689990d24174c62f265b1ca91ba18aabfda7eebe3d40cb379c91ab4f834c6d778e47555d
8
+ metadata.gz: !binary |-
9
+ NmIwNzQwMWE0ZDg1ZGIxMmI2ZjdiNGIxMzNjNDgzZGM5OTY2YTgzODQxN2Y0
10
+ NjAyNWM4Nzc4YTYxODczZDQ0OWY3OGYxYTU3OGRkZDZlNTBkM2YyOTA1MGUx
11
+ NDU2YTUxODk4ZDgzYmI3OTg4ZjE0NTY5MWFmOWQ5OWNiMmQ1ZGU=
12
+ data.tar.gz: !binary |-
13
+ MGZmNzdiYTg4ZTk1ZWZjZTIyMjkxODEwYTU3NjA0MDRmNWJjYmNhMzFmODM2
14
+ NDBhODJhMTNjNjA4OGYwYTE1MTk3ZjY3NTU2Y2FlNDdlMzRiODg5MjU0Y2Yx
15
+ MTMyN2UxOGYwNzQ1NmY2OWU0ZGNjZDE1OTI3NmQzNTMzYzEyMWQ=
data/.gitignore CHANGED
@@ -2,5 +2,7 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
- .idea/
6
5
  .rspec
6
+ .rvmrc
7
+ .idea/
8
+
@@ -0,0 +1 @@
1
+ taza
@@ -0,0 +1 @@
1
+ 1.9.3
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ before_install: gem install bundler -v 1.11.2
2
3
  script: "bundle exec rspec spec"
3
4
  rvm:
4
5
  - 1.9.3
@@ -6,7 +7,7 @@ rvm:
6
7
  - 2.1.0
7
8
  - ruby-head
8
9
  - jruby-19mode
9
- - rbx
10
+ - rbx-2
10
11
  notifications:
11
12
  email:
12
13
  - pnascimento@gmail.com
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in taza.gemspec
4
4
  gemspec
@@ -1,3 +1,7 @@
1
+ === 1.0
2
+ updated to RSpec 3 (thanks @drewboardman)
3
+ taza now accepts erb settings.yml (thanks @drewboardman)
4
+
1
5
  === 0.9.1.2
2
6
  Experimental pure Webdriver support
3
7
  Fix app generator (thanks @certonaqa)
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
- [![Code Climate](https://codeclimate.com/github/hammernight/taza.png)](https://codeclimate.com/github/hammernight/taza)
8
+
4
9
 
5
10
  * https://github.com/hammernight/taza
6
11
  * Wiki: http://github.com/scudco/taza/wikis
@@ -1,4 +1,4 @@
1
- require 'rspec/core/formatters/documentation_formatter'
1
+ require 'rspec'
2
2
 
3
3
  class FailingExamplesFormatter < RSpec::Core::Formatters::DocumentationFormatter
4
4
 
@@ -1,5 +1,4 @@
1
1
  require 'active_support/all'
2
- require 'rspec'
3
2
  require 'taza/version'
4
3
  require 'taza/page'
5
4
  require 'taza/site'
@@ -57,9 +57,9 @@ module Taza
57
57
  def self.watir_ie(params)
58
58
  require 'watir'
59
59
  if params[:attach]
60
- browser = Watir::IE.find(:title, //)
60
+ browser = Watir::Browser.find(:title, //)
61
61
  end
62
- browser || Watir::IE.new
62
+ browser || Watir::Browser.new
63
63
  end
64
64
  end
65
65
 
@@ -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()).each do |key, value|
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
@@ -23,7 +23,7 @@ module Taza
23
23
  end
24
24
 
25
25
  def self.site_file(site_name) # :nodoc:
26
- YAML.load_file(File.join(config_folder,"#{site_name.underscore}.yml"))[ENV['TAZA_ENV']]
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:
@@ -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:
@@ -1,3 +1,3 @@
1
1
  module Taza
2
- VERSION = "0.9.2.1"
2
+ VERSION = "1.0"
3
3
  end
@@ -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 be_true
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 be_true
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 be_true
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 be_true
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 be_true
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 be_true
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 be_true
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}").should be_true
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 be_true
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 be_true
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 be_true
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}").should be_true
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 be_true
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 be_true
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 be_true
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 be_true
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')).should be_true
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')).should be_true
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 be_true
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 be_true
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 be_true
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 be_true
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 be_true
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 be_true
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
- pending 'will have to fix this later'
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.should_not be_nil
53
- foo.should be_a_kind_of(Taza::Site)
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 "Taza bin" do
6
-
7
- it 'runs from the terminal' do
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 "should have an executable script" do
14
- pending "Not sure this is really necessary, as this is just testing if command line returns anything. It also breaks JRuby."
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}").should be_true
14
+ expect(system("ruby -c #{taza_bin} > #{null_device}")).to be true
18
15
  end
19
-
20
16
  end
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
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::IE.stubs(:find).returns(browser)
23
- Watir::IE.stubs(:new).returns(browser)
24
- old_browser = Watir::IE.new
25
- new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir, :attach => true)
26
- new_browser.should eql(old_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::IE.stubs(:find).returns()
33
- Watir::IE.stubs(:new).returns(browser)
34
- new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir)
35
- browser.nil?.should be_false
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::IE.stubs(:find).returns(foo)
42
- Watir::IE.stubs(:new).returns(bar)
43
- new_browser = Taza::Browser.create(:browser => :ie, :driver => :watir)
44
- new_browser.should_not eql(foo)
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
@@ -68,7 +68,7 @@ module Helpers
68
68
  end
69
69
 
70
70
  def stub_browser
71
- stub_browser = stub()
71
+ stub_browser = stub
72
72
  stub_browser.stubs(:goto)
73
73
  stub_browser.stubs(:close)
74
74
  ::Taza::Browser.stubs(:create).returns(stub_browser)
@@ -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].should_not be_equivalent([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].should_not be_equivalent([1,2,3,4])
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].should be_equivalent([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].should be_equivalent([2,1,3])
15
+ expect([1,2,3]).to be_equivalent [2,1,3]
16
16
  end
17
17
  end
@@ -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) }.should raise_error(StandardError)
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
- pending "Travis cant load selenium. :("
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.should be_a_kind_of(Selenium::SeleniumDriver)
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).should eql(Object)
64
+ expect(Taza::Browser.browser_class(:browser => :safari, :driver => :watir)).to eql Object
65
65
  end
66
66
 
67
67
  end