pretentious 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example.rb +12 -10
- data/lib/pretentious/minitest_generator.rb +6 -2
- data/lib/pretentious/version.rb +1 -1
- data/pretentious.gemspec +2 -2
- data/run_test.sh +1 -1
- data/spec/minitest_generator_spec.rb +1 -1
- data/spec/test_class1_spec.rb +8 -8
- data/spec/test_class3_spec.rb +4 -4
- data/spec/test_class4_spec.rb +2 -2
- data/spec/test_class_for_auto_stub_spec.rb +1 -1
- data/spec/test_class_for_mocks_spec.rb +4 -4
- data/test/test_fibonacci.rb +47 -0
- data/test/test_m_d5.rb +18 -0
- data/test/test_meme.rb +2 -2
- data/test/test_test_class1.rb +13 -13
- data/test/test_test_class2.rb +4 -4
- data/test/test_test_class3.rb +7 -7
- data/test/test_test_class4.rb +4 -4
- data/test/test_test_class_for_mocks.rb +7 -7
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2d6ae04a184a2d01faa3d4b57870c670ed7a2d
|
4
|
+
data.tar.gz: e901c224433743d694beae8e5824dd79dbda0e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f03e00d1f288a00205e8aa7318bf8abf90262ecd534d6ccf292d54014706147eb679a4a4859d4a339c8a877b08012b691dbc104728229d0f1472126abc7b0b00
|
7
|
+
data.tar.gz: 6be334899e32a59c1f5930ea885d40a7639c74623de6a19b63f017dc02838ae2130343288fcb3d372667fbf16c108fb367af5289a179095bca38f367653de7aa
|
data/example.rb
CHANGED
@@ -3,18 +3,18 @@ $LOAD_PATH << '.'
|
|
3
3
|
require 'digest/md5'
|
4
4
|
require_relative './test_classes.rb'
|
5
5
|
|
6
|
+
[:spec_for, :minitest_for].each do |method|
|
7
|
+
Pretentious.send(method, Fibonacci) do
|
6
8
|
|
7
|
-
|
9
|
+
instance = Fibonacci.new
|
8
10
|
|
11
|
+
(1..5).each do |n|
|
12
|
+
instance.fib(n)
|
13
|
+
end
|
9
14
|
|
10
|
-
|
15
|
+
Fibonacci.say_hello
|
11
16
|
|
12
|
-
(1..5).each do |n|
|
13
|
-
instance.fib(n)
|
14
17
|
end
|
15
|
-
|
16
|
-
Fibonacci.say_hello
|
17
|
-
|
18
18
|
end
|
19
19
|
|
20
20
|
[:spec_for, :minitest_for].each do |method|
|
@@ -63,9 +63,11 @@ end
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
[:spec_for, :minitest_for].each do |method|
|
67
|
+
Pretentious.send(method, Digest::MD5) do
|
68
|
+
sample = "This is the digest"
|
69
|
+
Digest::MD5.hexdigest(sample)
|
70
|
+
end
|
69
71
|
end
|
70
72
|
|
71
73
|
[:spec_for, :minitest_for].each do |m|
|
@@ -28,7 +28,7 @@ class Pretentious::MinitestGenerator < Pretentious::GeneratorBase
|
|
28
28
|
buffer("require 'minitest_helper'")
|
29
29
|
buffer('require "minitest/autorun"')
|
30
30
|
whitespace
|
31
|
-
buffer("class
|
31
|
+
buffer("class #{test_class.name}Test < Minitest::Test")
|
32
32
|
buffer("end")
|
33
33
|
whitespace
|
34
34
|
end
|
@@ -43,12 +43,16 @@ class Pretentious::MinitestGenerator < Pretentious::GeneratorBase
|
|
43
43
|
def generate(test_instance, instance_count)
|
44
44
|
global_variable_declaration = {}
|
45
45
|
if (test_instance.is_a? Class)
|
46
|
+
buffer("class #{test_instance.test_class.name}Scenario#{instance_count} < #{@test_class.name}Test",0)
|
47
|
+
|
46
48
|
#class methods
|
47
49
|
class_method_calls = test_instance.method_calls_by_method
|
48
50
|
buffer(generate_specs("#{test_instance.test_class.name}::",test_instance.test_class.name, class_method_calls, test_instance.let_variables,
|
49
51
|
global_variable_declaration, {}))
|
52
|
+
|
53
|
+
buffer('end',0)
|
50
54
|
else
|
51
|
-
buffer("class #{test_instance.test_class.name}Scenario#{instance_count} <
|
55
|
+
buffer("class #{test_instance.test_class.name}Scenario#{instance_count} < #{@test_class.name}Test",0)
|
52
56
|
|
53
57
|
buffer("def setup",1)
|
54
58
|
|
data/lib/pretentious/version.rb
CHANGED
data/pretentious.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Pretentious::VERSION
|
9
9
|
spec.authors = ["Joseph Emmanuel Dayo"]
|
10
10
|
spec.email = ["joseph.dayo@gmail.com"]
|
11
|
-
spec.summary = %q{Generate tests from existing code as well as a way to deal with pretentious TDD/BDD developers}
|
12
|
-
spec.description = %q{Do you have a pretentious boss or dev lead that pushes you to embrace tdd but for reasons hate it or them? here is a gem to deal with that.}
|
11
|
+
spec.summary = %q{Characterization Tests generator for Ruby - Generate tests from existing/legacy code as well as a way to deal with pretentious TDD/BDD developers}
|
12
|
+
spec.description = %q{Characterization Tests for Ruby - Do you have a pretentious boss or dev lead that pushes you to embrace tdd but for reasons hate it or them? here is a gem to deal with that.}
|
13
13
|
spec.homepage = "https://github.com/jedld/pretentious"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
data/run_test.sh
CHANGED
@@ -18,7 +18,7 @@ RSpec.describe Pretentious::Generator do
|
|
18
18
|
result = Pretentious::Generator.generate_for(Fibonacci) do
|
19
19
|
Fibonacci.say_hello
|
20
20
|
end
|
21
|
-
expect(result).to eq({Fibonacci =>{output:
|
21
|
+
expect(result).to eq({Fibonacci =>{output: "#This file was automatically generated by the pretentious gem\nrequire 'minitest_helper'\nrequire \"minitest/autorun\"\n\nclass FibonacciTest < Minitest::Test\nend\n\nclass FibonacciScenario1 < FibonacciTest\n def test_current_expectation\n #Fibonacci::say_hello should return hello\n assert_equal \"hello\", Fibonacci.say_hello\n\n\n end\n\nend\n",
|
22
22
|
generator: Pretentious::MinitestGenerator }})
|
23
23
|
end
|
24
24
|
|
data/spec/test_class1_spec.rb
CHANGED
@@ -26,12 +26,12 @@ RSpec.describe TestClass1 do
|
|
26
26
|
|
27
27
|
it 'should pass current expectations' do
|
28
28
|
|
29
|
-
|
29
|
+
var_2169524400 = Proc.new { |message|
|
30
30
|
@message
|
31
31
|
}
|
32
32
|
|
33
33
|
test_class1 = nil
|
34
|
-
|
34
|
+
var_2169511140 = Proc.new {
|
35
35
|
# Variable return values ... can't figure out what goes in here...
|
36
36
|
}
|
37
37
|
|
@@ -42,11 +42,11 @@ RSpec.describe TestClass1 do
|
|
42
42
|
# TestClass1#print_message should return
|
43
43
|
expect( @fixture.print_message ).to be_nil
|
44
44
|
|
45
|
-
# TestClass1#set_block should return #<Pretentious::RecordedProc:
|
46
|
-
expect( @fixture.set_block &
|
45
|
+
# TestClass1#set_block should return #<Pretentious::RecordedProc:0x00000102a00f98@example.rb:73>
|
46
|
+
expect( @fixture.set_block &var_2169524400 ).to eq(var_2169524400)
|
47
47
|
|
48
|
-
# TestClass1#call_block should return {:hello=>"world", :test=>#<TestClass1:
|
49
|
-
expect( @fixture.call_block &
|
48
|
+
# TestClass1#call_block should return {:hello=>"world", :test=>#<TestClass1:0x00000101db0950 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2163049820=>"message"}>, :arr_1=>[1, 2, 3, 4, 5, #<TestClass1:0x00000101db0950 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2163049820=>"message"}>], :sub_hash=>{:yes=>true, :obj=>#<TestClass1:0x00000101db0950 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2163049820=>"message"}>}}
|
49
|
+
expect( @fixture.call_block &var_2169511140 ).to eq(@message)
|
50
50
|
|
51
51
|
# TestClass1#something_is_wrong should return StandardError
|
52
52
|
expect { @fixture.something_is_wrong }.to raise_error
|
@@ -67,7 +67,7 @@ RSpec.describe TestClass1 do
|
|
67
67
|
|
68
68
|
another_object = TestClass1.new("test")
|
69
69
|
|
70
|
-
# TestClass1#return_self when passed message = #<TestClass1:
|
70
|
+
# TestClass1#return_self when passed message = #<TestClass1:0x00000101db0950> should return #<TestClass1:0x00000101db0950>
|
71
71
|
expect( @fixture.return_self(another_object) ).to eq(another_object)
|
72
72
|
|
73
73
|
end
|
@@ -82,7 +82,7 @@ RSpec.describe TestClass1 do
|
|
82
82
|
|
83
83
|
it 'should pass current expectations' do
|
84
84
|
|
85
|
-
# TestClass1#message should return #<TestClass1:
|
85
|
+
# TestClass1#message should return #<TestClass1:0x00000101db0950>
|
86
86
|
expect( @fixture.message ).to eq(@message)
|
87
87
|
|
88
88
|
end
|
data/spec/test_class3_spec.rb
CHANGED
@@ -6,8 +6,8 @@ RSpec.describe TestClass3 do
|
|
6
6
|
context 'Scenario 1' do
|
7
7
|
before do
|
8
8
|
another_object = TestClass1.new("test")
|
9
|
-
|
10
|
-
testclass1 = TestClass1.new(
|
9
|
+
var_2163035800 = {hello: "world", test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: {yes: true, obj: another_object}}
|
10
|
+
testclass1 = TestClass1.new(var_2163035800)
|
11
11
|
testclass2 = TestClass2.new("This is message 2", nil)
|
12
12
|
@fixture = TestClass3.new(testclass1, testclass2)
|
13
13
|
end
|
@@ -24,8 +24,8 @@ RSpec.describe TestClass3 do
|
|
24
24
|
context 'Scenario 2' do
|
25
25
|
before do
|
26
26
|
another_object = TestClass1.new("test")
|
27
|
-
|
28
|
-
testclass1 = TestClass1.new(
|
27
|
+
var_2163035800 = {hello: "world", test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: {yes: true, obj: another_object}}
|
28
|
+
testclass1 = TestClass1.new(var_2163035800)
|
29
29
|
testclass2 = TestClass2.new("This is message 2", nil)
|
30
30
|
@fixture = TestClass3.new(testclass1, testclass2)
|
31
31
|
end
|
data/spec/test_class4_spec.rb
CHANGED
@@ -6,11 +6,11 @@ RSpec.describe TestClass4 do
|
|
6
6
|
context 'Scenario 1' do
|
7
7
|
before do
|
8
8
|
var_8 = nil
|
9
|
-
|
9
|
+
var_2162919380 = Proc.new {
|
10
10
|
# Variable return values ... can't figure out what goes in here...
|
11
11
|
}
|
12
12
|
|
13
|
-
@fixture = TestClass4.new(&
|
13
|
+
@fixture = TestClass4.new(&var_2162919380)
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'should pass current expectations' do
|
@@ -10,7 +10,7 @@ RSpec.describe TestClassForAutoStub do
|
|
10
10
|
|
11
11
|
it 'should pass current expectations' do
|
12
12
|
|
13
|
-
|
13
|
+
var_2162129300 = ["Hello Glorious world", "HI THERE!!!!"]
|
14
14
|
|
15
15
|
allow_any_instance_of(ClassUsedByTestClass).to receive(:stubbed_method).and_return("Hello Glorious world")
|
16
16
|
allow_any_instance_of(AnotherClassUsedByTestClass).to receive(:get_message).and_return("HI THERE!!!!")
|
@@ -10,7 +10,7 @@ RSpec.describe TestClassForMocks do
|
|
10
10
|
|
11
11
|
it 'should pass current expectations' do
|
12
12
|
|
13
|
-
|
13
|
+
var_2169542660 = [2, 3, 4, 5]
|
14
14
|
|
15
15
|
allow_any_instance_of(TestMockSubClass).to receive(:test_method).and_return("a return string")
|
16
16
|
allow_any_instance_of(TestMockSubClass).to receive(:increment_val).and_return(2, 3, 4, 5)
|
@@ -38,12 +38,12 @@ RSpec.describe TestClassForMocks do
|
|
38
38
|
|
39
39
|
it 'should pass current expectations' do
|
40
40
|
|
41
|
-
|
41
|
+
var_2169409740 = {val: 1, str: "hello world", message: "a message"}
|
42
42
|
|
43
|
-
allow_any_instance_of(TestMockSubClass).to receive(:return_hash).and_return(
|
43
|
+
allow_any_instance_of(TestMockSubClass).to receive(:return_hash).and_return(var_2169409740)
|
44
44
|
|
45
45
|
# TestClassForMocks#method_with_usage3 when passed message = "a message" should return {:val=>1, :str=>"hello world", :message=>"a message"}
|
46
|
-
expect( @fixture.method_with_usage3("a message") ).to eq(
|
46
|
+
expect( @fixture.method_with_usage3("a message") ).to eq(var_2169409740)
|
47
47
|
|
48
48
|
end
|
49
49
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#This file was automatically generated by the pretentious gem
|
2
|
+
require 'minitest_helper'
|
3
|
+
require "minitest/autorun"
|
4
|
+
|
5
|
+
class FibonacciTest < Minitest::Test
|
6
|
+
end
|
7
|
+
|
8
|
+
class FibonacciScenario1 < FibonacciTest
|
9
|
+
def setup
|
10
|
+
@fixture = Fibonacci.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_current_expectation
|
14
|
+
n = 1
|
15
|
+
n_1 = 2
|
16
|
+
n_2 = 3
|
17
|
+
n_3 = 4
|
18
|
+
n_4 = 5
|
19
|
+
|
20
|
+
#Fibonacci#fib when passed n = 1 should return 1
|
21
|
+
assert_equal 1, @fixture.fib(n)
|
22
|
+
|
23
|
+
#Fibonacci#fib when passed n = 2 should return 1
|
24
|
+
assert_equal 1, @fixture.fib(n_1)
|
25
|
+
|
26
|
+
#Fibonacci#fib when passed n = 3 should return 2
|
27
|
+
assert_equal 2, @fixture.fib(n_2)
|
28
|
+
|
29
|
+
#Fibonacci#fib when passed n = 4 should return 3
|
30
|
+
assert_equal 3, @fixture.fib(n_3)
|
31
|
+
|
32
|
+
#Fibonacci#fib when passed n = 5 should return 5
|
33
|
+
assert_equal 5, @fixture.fib(n_4)
|
34
|
+
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class FibonacciScenario2 < FibonacciTest
|
40
|
+
def test_current_expectation
|
41
|
+
#Fibonacci::say_hello should return hello
|
42
|
+
assert_equal "hello", Fibonacci.say_hello
|
43
|
+
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
data/test/test_m_d5.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#This file was automatically generated by the pretentious gem
|
2
|
+
require 'minitest_helper'
|
3
|
+
require "minitest/autorun"
|
4
|
+
|
5
|
+
class Digest::MD5Test < Minitest::Test
|
6
|
+
end
|
7
|
+
|
8
|
+
class Digest::MD5Scenario1 < Digest::MD5Test
|
9
|
+
def test_current_expectation
|
10
|
+
sample = "This is the digest"
|
11
|
+
|
12
|
+
#Digest::MD5::hexdigest when passed "This is the digest" should return 9f12248dcddeda976611d192efaaf72a
|
13
|
+
assert_equal "9f12248dcddeda976611d192efaaf72a", Digest::MD5.hexdigest(sample)
|
14
|
+
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/test/test_meme.rb
CHANGED
data/test/test_test_class1.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestClass1Test < Minitest::Test
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestClass1Scenario1 <
|
8
|
+
class TestClass1Scenario1 < TestClass1Test
|
9
9
|
def setup
|
10
10
|
@fixture = TestClass1.new("test")
|
11
11
|
end
|
@@ -18,7 +18,7 @@ class TestClass1Scenario1 < TestTestClass1
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
class TestClass1Scenario2 <
|
21
|
+
class TestClass1Scenario2 < TestClass1Test
|
22
22
|
def setup
|
23
23
|
@another_object = TestClass1.new("test")
|
24
24
|
@message = {hello: "world", test: @another_object, arr_1: [1, 2, 3, 4, 5, @another_object], sub_hash: {yes: true, obj: @another_object}}
|
@@ -26,12 +26,12 @@ class TestClass1Scenario2 < TestTestClass1
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def test_current_expectation
|
29
|
-
|
29
|
+
var_2169910980 = Proc.new { |message|
|
30
30
|
@message
|
31
31
|
}
|
32
32
|
|
33
33
|
test_class1 = nil
|
34
|
-
|
34
|
+
var_2169892180 = Proc.new {
|
35
35
|
# Variable return values ... can't figure out what goes in here...
|
36
36
|
}
|
37
37
|
|
@@ -42,11 +42,11 @@ class TestClass1Scenario2 < TestTestClass1
|
|
42
42
|
#TestClass1#print_message should return
|
43
43
|
assert_nil @fixture.print_message
|
44
44
|
|
45
|
-
#TestClass1#set_block should return #<Pretentious::RecordedProc:
|
46
|
-
assert_equal
|
45
|
+
#TestClass1#set_block should return #<Pretentious::RecordedProc:0x00000102abde18@example.rb:73>
|
46
|
+
assert_equal var_2169910980, @fixture.set_block( &var_2169910980)
|
47
47
|
|
48
|
-
#TestClass1#call_block should return {:hello=>"world", :test=>#<TestClass1:
|
49
|
-
assert_equal @message, @fixture.call_block( &
|
48
|
+
#TestClass1#call_block should return {:hello=>"world", :test=>#<TestClass1:0x000001022acee0 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2165663980=>"message"}>, :arr_1=>[1, 2, 3, 4, 5, #<TestClass1:0x000001022acee0 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2165663980=>"message"}>], :sub_hash=>{:yes=>true, :obj=>#<TestClass1:0x000001022acee0 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={2165663980=>"message"}>}}
|
49
|
+
assert_equal @message, @fixture.call_block( &var_2169892180)
|
50
50
|
|
51
51
|
#TestClass1#something_is_wrong should return StandardError
|
52
52
|
assert_raises(StandardError) { @fixture.something_is_wrong }
|
@@ -58,7 +58,7 @@ class TestClass1Scenario2 < TestTestClass1
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
class TestClass1Scenario3 <
|
61
|
+
class TestClass1Scenario3 < TestClass1Test
|
62
62
|
def setup
|
63
63
|
@fixture = TestClass1.new("Hello")
|
64
64
|
end
|
@@ -66,21 +66,21 @@ class TestClass1Scenario3 < TestTestClass1
|
|
66
66
|
def test_current_expectation
|
67
67
|
another_object = TestClass1.new("test")
|
68
68
|
|
69
|
-
#TestClass1#return_self when passed message = #<TestClass1:
|
69
|
+
#TestClass1#return_self when passed message = #<TestClass1:0x000001022acee0> should return #<TestClass1:0x000001022acee0>
|
70
70
|
assert_equal another_object, @fixture.return_self(another_object)
|
71
71
|
|
72
72
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
class TestClass1Scenario4 <
|
76
|
+
class TestClass1Scenario4 < TestClass1Test
|
77
77
|
def setup
|
78
78
|
@message = TestClass1.new("test")
|
79
79
|
@fixture = TestClass1.new(@message)
|
80
80
|
end
|
81
81
|
|
82
82
|
def test_current_expectation
|
83
|
-
#TestClass1#message should return #<TestClass1:
|
83
|
+
#TestClass1#message should return #<TestClass1:0x000001022acee0>
|
84
84
|
assert_equal @message, @fixture.message
|
85
85
|
|
86
86
|
|
data/test/test_test_class2.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestClass2Test < Minitest::Test
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestClass2Scenario1 <
|
8
|
+
class TestClass2Scenario1 < TestClass2Test
|
9
9
|
def setup
|
10
10
|
@fixture = TestClass2.new("This is message 2", nil)
|
11
11
|
end
|
@@ -21,7 +21,7 @@ class TestClass2Scenario1 < TestTestClass2
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
class TestClass2Scenario2 <
|
24
|
+
class TestClass2Scenario2 < TestClass2Test
|
25
25
|
def setup
|
26
26
|
@fixture = TestClass2.new("This is message 3", nil)
|
27
27
|
end
|
@@ -31,7 +31,7 @@ class TestClass2Scenario2 < TestTestClass2
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
class TestClass2Scenario3 <
|
34
|
+
class TestClass2Scenario3 < TestClass2Test
|
35
35
|
def setup
|
36
36
|
@message2 = "This is message 3"
|
37
37
|
message = TestClass2.new(@message2, nil)
|
data/test/test_test_class3.rb
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestClass3Test < Minitest::Test
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestClass3Scenario1 <
|
8
|
+
class TestClass3Scenario1 < TestClass3Test
|
9
9
|
def setup
|
10
10
|
another_object = TestClass1.new("test")
|
11
|
-
|
12
|
-
testclass1 = TestClass1.new(
|
11
|
+
var_2165630660 = {hello: "world", test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: {yes: true, obj: another_object}}
|
12
|
+
testclass1 = TestClass1.new(var_2165630660)
|
13
13
|
testclass2 = TestClass2.new("This is message 2", nil)
|
14
14
|
@fixture = TestClass3.new(testclass1, testclass2)
|
15
15
|
end
|
@@ -22,11 +22,11 @@ class TestClass3Scenario1 < TestTestClass3
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
class TestClass3Scenario2 <
|
25
|
+
class TestClass3Scenario2 < TestClass3Test
|
26
26
|
def setup
|
27
27
|
another_object = TestClass1.new("test")
|
28
|
-
|
29
|
-
testclass1 = TestClass1.new(
|
28
|
+
var_2165630660 = {hello: "world", test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: {yes: true, obj: another_object}}
|
29
|
+
testclass1 = TestClass1.new(var_2165630660)
|
30
30
|
testclass2 = TestClass2.new("This is message 2", nil)
|
31
31
|
@fixture = TestClass3.new(testclass1, testclass2)
|
32
32
|
end
|
data/test/test_test_class4.rb
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestClass4Test < Minitest::Test
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestClass4Scenario1 <
|
8
|
+
class TestClass4Scenario1 < TestClass4Test
|
9
9
|
def setup
|
10
10
|
var_8 = nil
|
11
|
-
|
11
|
+
var_2169971280 = Proc.new {
|
12
12
|
# Variable return values ... can't figure out what goes in here...
|
13
13
|
}
|
14
14
|
|
15
|
-
@fixture = TestClass4.new(&
|
15
|
+
@fixture = TestClass4.new(&var_2169971280)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_current_expectation
|
@@ -2,16 +2,16 @@
|
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
5
|
-
class
|
5
|
+
class TestClassForMocksTest < Minitest::Test
|
6
6
|
end
|
7
7
|
|
8
|
-
class TestClassForMocksScenario1 <
|
8
|
+
class TestClassForMocksScenario1 < TestClassForMocksTest
|
9
9
|
def setup
|
10
10
|
@fixture = TestClassForMocks.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_current_expectation
|
14
|
-
|
14
|
+
var_2169291380 = [2, 3, 4, 5]
|
15
15
|
|
16
16
|
TestMockSubClass.stub_any_instance(:test_method, "a return string") do
|
17
17
|
TestMockSubClass.stub_any_instance(:increment_val, 2) do
|
@@ -33,17 +33,17 @@ class TestClassForMocksScenario1 < TestTestClassForMocks
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
class TestClassForMocksScenario2 <
|
36
|
+
class TestClassForMocksScenario2 < TestClassForMocksTest
|
37
37
|
def setup
|
38
38
|
@fixture = TestClassForMocks.new
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_current_expectation
|
42
|
-
|
42
|
+
var_2169019300 = {val: 1, str: "hello world", message: "a message"}
|
43
43
|
|
44
|
-
TestMockSubClass.stub_any_instance(:return_hash,
|
44
|
+
TestMockSubClass.stub_any_instance(:return_hash, var_2169019300) do
|
45
45
|
#TestClassForMocks#method_with_usage3 when passed message = "a message" should return {:val=>1, :str=>"hello world", :message=>"a message"}
|
46
|
-
assert_equal
|
46
|
+
assert_equal var_2169019300, @fixture.method_with_usage3("a message")
|
47
47
|
|
48
48
|
end
|
49
49
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretentious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Emmanuel Dayo
|
@@ -108,8 +108,9 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description: Do you have a pretentious boss or dev
|
112
|
-
tdd but for reasons hate it or them? here is a gem
|
111
|
+
description: Characterization Tests for Ruby - Do you have a pretentious boss or dev
|
112
|
+
lead that pushes you to embrace tdd but for reasons hate it or them? here is a gem
|
113
|
+
to deal with that.
|
113
114
|
email:
|
114
115
|
- joseph.dayo@gmail.com
|
115
116
|
executables:
|
@@ -149,7 +150,9 @@ files:
|
|
149
150
|
- spec/test_class_for_auto_stub_spec.rb
|
150
151
|
- spec/test_class_for_mocks_spec.rb
|
151
152
|
- test/minitest_helper.rb
|
153
|
+
- test/test_fibonacci.rb
|
152
154
|
- test/test_generator.rb
|
155
|
+
- test/test_m_d5.rb
|
153
156
|
- test/test_meme.rb
|
154
157
|
- test/test_test_class1.rb
|
155
158
|
- test/test_test_class2.rb
|
@@ -180,8 +183,8 @@ rubyforge_project:
|
|
180
183
|
rubygems_version: 2.2.2
|
181
184
|
signing_key:
|
182
185
|
specification_version: 4
|
183
|
-
summary:
|
184
|
-
TDD/BDD developers
|
186
|
+
summary: Characterization Tests generator for Ruby - Generate tests from existing/legacy
|
187
|
+
code as well as a way to deal with pretentious TDD/BDD developers
|
185
188
|
test_files:
|
186
189
|
- spec/deconstructor_spec.rb
|
187
190
|
- spec/fibonacci_spec.rb
|
@@ -197,7 +200,9 @@ test_files:
|
|
197
200
|
- spec/test_class_for_auto_stub_spec.rb
|
198
201
|
- spec/test_class_for_mocks_spec.rb
|
199
202
|
- test/minitest_helper.rb
|
203
|
+
- test/test_fibonacci.rb
|
200
204
|
- test/test_generator.rb
|
205
|
+
- test/test_m_d5.rb
|
201
206
|
- test/test_meme.rb
|
202
207
|
- test/test_test_class1.rb
|
203
208
|
- test/test_test_class2.rb
|