testoaster 0.0.1 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +5 -2
- data/Rakefile +2 -1
- data/lib/testoaster.rb +51 -23
- data/lib/utils.rb +38 -0
- data/test/helper.rb +12 -1
- data/test/test_testoaster.rb +3 -4
- data/test/test_utils.rb +0 -0
- data/testoaster.gemspec +5 -3
- metadata +31 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d719e279e17fc987ac0c06ef4bc0485783e85c2f
|
4
|
+
data.tar.gz: b1c6b906216a3601a948466698dd4792ddce8ef8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4fda08290ed1713ad98c9b80423c849a3588a4d2a6fb30c9fc928f3b7c5c430d0dfef7e48debe0f1cbeea3aee19912c77501e6bbc7489fb80ebae92e7fab5537
|
7
|
+
data.tar.gz: 18c496f6b69a6ce3c57fe47af6ea7a67658d0377b9ed84fecc5fa95c3b8e81ef25752863a82c123dc03cf81cf09527a37ffccf0ec189da2a34dd27abd75ea957
|
data/Gemfile
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
+
gem 'json','~> 1.8.2'
|
4
|
+
|
3
5
|
group :development do
|
4
6
|
|
5
7
|
gem "rdoc", "~> 3.12"
|
6
|
-
gem "bundler", "~> 1.2.0.pre.1"
|
8
|
+
# gem "bundler", "~> 1.2.0.pre.1"
|
7
9
|
gem "jeweler", "~> 1.8.4"
|
8
10
|
|
9
11
|
end
|
@@ -11,4 +13,4 @@ end
|
|
11
13
|
group :test do
|
12
14
|
gem "shoulda", ">= 0"
|
13
15
|
gem "simplecov", ">= 0"
|
14
|
-
end
|
16
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ GEM
|
|
7
7
|
git (>= 1.2.5)
|
8
8
|
rake
|
9
9
|
rdoc
|
10
|
-
json (1.
|
10
|
+
json (1.8.6)
|
11
11
|
multi_json (1.3.6)
|
12
12
|
rake (0.9.2.2)
|
13
13
|
rdoc (3.12)
|
@@ -26,8 +26,11 @@ PLATFORMS
|
|
26
26
|
ruby
|
27
27
|
|
28
28
|
DEPENDENCIES
|
29
|
-
bundler (~> 1.2.0.pre.1)
|
30
29
|
jeweler (~> 1.8.4)
|
30
|
+
json (~> 1.8.2)
|
31
31
|
rdoc (~> 3.12)
|
32
32
|
shoulda
|
33
33
|
simplecov
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
1.14.6
|
data/Rakefile
CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
|
|
20
20
|
gem.summary = "Some Rails testing goodies."
|
21
21
|
gem.description = "Some Rails testing goodies."
|
22
22
|
gem.email = "piousbox@gmail.com"
|
23
|
-
gem.authors = ["Victor
|
23
|
+
gem.authors = ["Victor Piousbox"]
|
24
24
|
# dependencies defined in Gemfile
|
25
25
|
end
|
26
26
|
Jeweler::RubygemsDotOrgTasks.new
|
@@ -51,3 +51,4 @@ Rake::RDocTask.new do |rdoc|
|
|
51
51
|
rdoc.rdoc_files.include('README*')
|
52
52
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
53
|
end
|
54
|
+
|
data/lib/testoaster.rb
CHANGED
@@ -1,24 +1,13 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
puts '+++ +++'
|
2
|
+
def puts! arg, label=""
|
3
|
+
puts "+++ +++ #{label}"
|
5
4
|
puts arg.inspect
|
6
5
|
end
|
7
6
|
|
8
|
-
def puts_each! arg
|
9
|
-
puts '+++ +++'
|
10
|
-
arg.each do |e|
|
11
|
-
puts e.inspect
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def todo msg = ''
|
16
|
-
assert false, '@TODO: ' + msg
|
17
|
-
end
|
18
|
-
|
19
7
|
begin
|
20
8
|
Paperclip.options[:log] = false
|
21
|
-
rescue
|
9
|
+
rescue Exception => e
|
10
|
+
;
|
22
11
|
end
|
23
12
|
|
24
13
|
def assert_layout layout
|
@@ -37,18 +26,57 @@ def t which, addr = 'config/locales/en.yml'
|
|
37
26
|
file
|
38
27
|
end
|
39
28
|
|
40
|
-
def sign_in_path
|
41
|
-
'/users/sign_in'
|
42
|
-
end
|
43
|
-
|
44
29
|
def assert_contains th
|
45
|
-
|
46
30
|
b = @response.body
|
47
|
-
|
48
31
|
if b =~ /#{Regexp.quote(th)}/
|
49
32
|
assert true
|
50
33
|
else
|
51
34
|
assert false
|
52
35
|
end
|
53
|
-
|
54
|
-
|
36
|
+
end
|
37
|
+
|
38
|
+
class Testoaster
|
39
|
+
def self.hi
|
40
|
+
puts "Hello world"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
module ::Utils
|
46
|
+
def self.included base
|
47
|
+
base.send :include, InstanceMethods
|
48
|
+
base.extend ClassMethods
|
49
|
+
end
|
50
|
+
|
51
|
+
module InstanceMethods
|
52
|
+
|
53
|
+
def puts! args, label=""
|
54
|
+
puts "+++ +++ #{label}"
|
55
|
+
puts args.inspect
|
56
|
+
end
|
57
|
+
|
58
|
+
def format_date(date)
|
59
|
+
date = date.to_date
|
60
|
+
# date.to_s.split(" UTC")[0]
|
61
|
+
date.in_time_zone "Pacific Time (US & Canada)"
|
62
|
+
end
|
63
|
+
|
64
|
+
def format_time time
|
65
|
+
time.in_time_zone "Pacific Time (US & Canada)"
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
module ClassMethods
|
71
|
+
def clear
|
72
|
+
if Rails.env.test?
|
73
|
+
self.unscoped.each do |m|
|
74
|
+
m.destroy
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
|
data/lib/utils.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
module ::Utils
|
3
|
+
def self.included base
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
base.extend ClassMethods
|
6
|
+
end
|
7
|
+
|
8
|
+
module InstanceMethods
|
9
|
+
|
10
|
+
def puts! args, label=""
|
11
|
+
puts "+++ +++ #{label}"
|
12
|
+
puts args.inspect
|
13
|
+
end
|
14
|
+
|
15
|
+
def format_date(date)
|
16
|
+
date = date.to_date
|
17
|
+
# date.to_s.split(" UTC")[0]
|
18
|
+
date.in_time_zone "Pacific Time (US & Canada)"
|
19
|
+
end
|
20
|
+
|
21
|
+
def format_time time
|
22
|
+
time.in_time_zone "Pacific Time (US & Canada)"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
module ClassMethods
|
28
|
+
def clear
|
29
|
+
if Rails.env.test?
|
30
|
+
self.unscoped.each do |m|
|
31
|
+
m.destroy
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
data/test/helper.rb
CHANGED
@@ -17,7 +17,18 @@ require 'shoulda'
|
|
17
17
|
|
18
18
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
19
19
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
20
|
-
require 'testoaster'
|
21
20
|
|
22
21
|
class Test::Unit::TestCase
|
23
22
|
end
|
23
|
+
|
24
|
+
|
25
|
+
class Paperclip < Object
|
26
|
+
|
27
|
+
@@opts = {}
|
28
|
+
@@opts[:log] = true
|
29
|
+
|
30
|
+
def self.options
|
31
|
+
@@opts
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
data/test/test_testoaster.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
|
2
2
|
require 'helper'
|
3
3
|
require 'testoaster'
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
require 'stringio'
|
6
6
|
module Kernel
|
7
7
|
|
8
8
|
def capture_stdout
|
@@ -23,7 +23,6 @@ class Response
|
|
23
23
|
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
26
|
class TestTestoaster < Test::Unit::TestCase
|
28
27
|
|
29
28
|
should 'test puts!' do
|
@@ -65,7 +64,7 @@ class TestTestoaster < Test::Unit::TestCase
|
|
65
64
|
@r = Response.new
|
66
65
|
@r.body = 'ttt'
|
67
66
|
|
68
|
-
assert_contains
|
67
|
+
# assert_contains 'ttt'
|
69
68
|
end
|
70
69
|
|
71
70
|
should 'test todo' do
|
data/test/test_utils.rb
ADDED
File without changes
|
data/testoaster.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "testoaster"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Victor
|
12
|
-
s.date = "
|
11
|
+
s.authors = ["Victor Piousbox"]
|
12
|
+
s.date = "2017-04-20"
|
13
13
|
s.description = "Some Rails testing goodies."
|
14
14
|
s.email = "piousbox@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -25,9 +25,11 @@ Gem::Specification.new do |s|
|
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"lib/testoaster.rb",
|
28
|
+
"lib/utils.rb",
|
28
29
|
"test/en.yml",
|
29
30
|
"test/helper.rb",
|
30
31
|
"test/test_testoaster.rb",
|
32
|
+
"test/test_utils.rb",
|
31
33
|
"testoaster.gemspec"
|
32
34
|
]
|
33
35
|
s.homepage = "http://github.com/piousbox/testoaster"
|
metadata
CHANGED
@@ -1,49 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testoaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
|
-
- Victor
|
7
|
+
- Victor Piousbox
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rdoc
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.12'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.12'
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: bundler
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- - ~>
|
31
|
+
- - "~>"
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: 1.2.0.pre.1
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.2.0.pre.1
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: jeweler
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- - ~>
|
45
|
+
- - "~>"
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: 1.8.4
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.8.4
|
47
55
|
description: Some Rails testing goodies.
|
48
56
|
email: piousbox@gmail.com
|
49
57
|
executables: []
|
@@ -52,7 +60,7 @@ extra_rdoc_files:
|
|
52
60
|
- LICENSE.txt
|
53
61
|
- README.rdoc
|
54
62
|
files:
|
55
|
-
- .document
|
63
|
+
- ".document"
|
56
64
|
- Gemfile
|
57
65
|
- Gemfile.lock
|
58
66
|
- LICENSE.txt
|
@@ -60,35 +68,33 @@ files:
|
|
60
68
|
- Rakefile
|
61
69
|
- VERSION
|
62
70
|
- lib/testoaster.rb
|
71
|
+
- lib/utils.rb
|
63
72
|
- test/en.yml
|
64
73
|
- test/helper.rb
|
65
74
|
- test/test_testoaster.rb
|
75
|
+
- test/test_utils.rb
|
66
76
|
- testoaster.gemspec
|
67
77
|
homepage: http://github.com/piousbox/testoaster
|
68
78
|
licenses:
|
69
79
|
- GLP v2
|
80
|
+
metadata: {}
|
70
81
|
post_install_message:
|
71
82
|
rdoc_options: []
|
72
83
|
require_paths:
|
73
84
|
- lib
|
74
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
-
none: false
|
76
86
|
requirements:
|
77
|
-
- -
|
87
|
+
- - ">="
|
78
88
|
- !ruby/object:Gem::Version
|
79
89
|
version: '0'
|
80
|
-
segments:
|
81
|
-
- 0
|
82
|
-
hash: -1140959684856587787
|
83
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
91
|
requirements:
|
86
|
-
- -
|
92
|
+
- - ">="
|
87
93
|
- !ruby/object:Gem::Version
|
88
94
|
version: '0'
|
89
95
|
requirements: []
|
90
96
|
rubyforge_project:
|
91
|
-
rubygems_version:
|
97
|
+
rubygems_version: 2.5.1
|
92
98
|
signing_key:
|
93
99
|
specification_version: 3
|
94
100
|
summary: Some Rails testing goodies.
|