ojo 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fb122efa0d57d0f24c768e2ddd60877062746bf
4
- data.tar.gz: 372a6fdbe461d6aa7b519bf4bbd4182a2df03e4f
3
+ metadata.gz: fc965e4b05eb265b42f3fc22c46f5898222a3fb4
4
+ data.tar.gz: 19f1b43550134f0982c9dd5030b6702a510d6ee5
5
5
  SHA512:
6
- metadata.gz: 336ea819a2118e57a750a404a8ed0256aaa8c5c1c3970d7c958be4d3cc065e1e42c3518294472fe92686aaf68046949d277215d8cc772b81393a58fabd337ca0
7
- data.tar.gz: b63f2c1b6cbcb0ead4b42404f1411839963d88ab5be0e4cf18d161c02b8a2814813a4e7050782091903010f38c8a8068a134fb5257d07cf2a44986585b5c669c
6
+ metadata.gz: e5d09e1f5ff347541cb6909029a886f7f55ee840b07514a7ed16e68eac05e12480b3530cb2f72cfe9f206362f347594f967b93f5a337970b8982aa8c067ea1e2
7
+ data.tar.gz: 0c891cfee69440cdf3f8c8b82badd7029c137aae5875cbbb6d400e89cd11e6a66923cfa61398842c4f0a8d6b7c4e78c5206762769ed00aeb0de7b2024672cfbe
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require "bundler/gem_tasks"
3
+ require 'bundler/gem_tasks'
4
4
 
5
5
  require 'ojo'
6
6
 
@@ -12,8 +12,16 @@ namespace :test do
12
12
  t.pattern = 'test/unit/**/*_test.rb'
13
13
  t.verbose = false
14
14
  end
15
+
16
+ desc 'phantom js'
17
+ Rake::TestTask.new :phantom do |t|
18
+ t.libs << '.'
19
+ t.libs << 'test'
20
+ t.pattern = 'test/phantom/**/*_test.rb'
21
+ t.verbose = false
22
+ end
15
23
  end
16
24
 
17
- task :test => [ 'test:units' ]
25
+ task :test => %w(test:units test:phantom)
18
26
 
19
27
  task :default => :test
data/lib/ojo.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'collimator'
2
+ require 'open4'
2
3
 
3
4
  require 'ojo/rails/engine' if defined?(Rails)
4
5
  require 'ojo/version'
data/lib/ojo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ojo
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
data/lib/tasks/ojo.rake CHANGED
@@ -3,8 +3,8 @@ require 'fileutils'
3
3
  namespace :ojo do
4
4
  desc 'use ojo to compare two branches'
5
5
  task :compare, [:branch_1, :branch_2] => :environment do |t, args|
6
- branch_1 = args.fetch(:branch_1, nil)
7
- branch_2 = args.fetch(:branch_2, nil)
6
+ branch_1 = args[:branch_1]
7
+ branch_2 = args[:branch_2]
8
8
 
9
9
  Ojo::Manager.new.compare(branch_1, branch_2)
10
10
  end
@@ -29,6 +29,5 @@ namespace :ojo do
29
29
  task :all => :environment do |t|
30
30
  Ojo::Manager.new.clear_all
31
31
  end
32
-
33
32
  end
34
33
  end
@@ -4,5 +4,8 @@ class TestAppTest < OjoApp::PhantomTestCase
4
4
  def test_index_page
5
5
  PageObjects::TestApp::IndexPage.visit
6
6
  Ojo.screenshot(branch_name, __method__)
7
+
8
+ expected_screenshot_file = File.join(Ojo.configuration.location, branch_name, "#{__method__}.png")
9
+ assert File.exist?(expected_screenshot_file), "the ojo screen shot file #{expected_screenshot_file} exists"
7
10
  end
8
11
  end
@@ -32,7 +32,6 @@ require 'page_objects'
32
32
  Capybara.default_driver = :poltergeist
33
33
  Capybara.javascript_driver = :poltergeist
34
34
 
35
-
36
35
  module OjoApp
37
36
  class PhantomTestCase < Minitest::Test
38
37
  include Capybara::DSL
@@ -40,28 +39,24 @@ module OjoApp
40
39
  def setup
41
40
  Ojo.screenshotter = lambda do |filename|
42
41
  page.save_screenshot(filename)
43
- puts "Screenshot taken and saved to #{filename}"
44
42
  end
45
43
  Capybara.reset!
46
44
  end
47
45
 
48
46
  def teardown
49
47
  Capybara.reset!
48
+ remove_test_screenshots
50
49
  end
51
50
 
52
51
  private
53
52
 
54
- def screenshot_path
55
- File.join(Rails.root, 'tmp', 'screenshots')
56
- end
57
-
58
- def screenshot_file(name)
59
- File.join(screenshot_path, branch_name, "#{name}.png")
60
- end
61
-
62
53
  def branch_name
63
54
  `git rev-parse --abbrev-ref HEAD`.chomp
64
55
  end
65
56
 
57
+ def remove_test_screenshots
58
+ branch_location = File.join(Ojo.configuration.location, branch_name)
59
+ FileUtils.rm_rf branch_location
60
+ end
66
61
  end
67
62
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- ojo (0.0.2)
4
+ ojo (1.0.0)
5
5
  collimator
6
6
  open4
7
7
 
@@ -112,6 +112,13 @@ class ManagerTest < Ojo::OjoTestCase
112
112
  end
113
113
  end
114
114
  assert_compare_output out.string, %w(branch_1 branch_1a)
115
+
116
+ out = capture_output do
117
+ Date.stub :today, Date.parse('1/10/2014') do
118
+ @manager.compare branch_1_name, branch_2_name
119
+ end
120
+ end
121
+ assert_compare_output out.string, %w(branch_1 branch_2)
115
122
  end
116
123
 
117
124
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ojo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - geordie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-16 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler