pretentious 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -5
- data/bin/ddtgen +13 -19
- data/lib/pretentious.rb +31 -31
- data/lib/pretentious/context.rb +86 -0
- data/lib/pretentious/deconstructor.rb +305 -368
- data/lib/pretentious/generator.rb +122 -149
- data/lib/pretentious/generator_base.rb +70 -9
- data/lib/pretentious/minitest_generator.rb +172 -288
- data/lib/pretentious/recorded_proc.rb +4 -16
- data/lib/pretentious/rspec_generator.rb +151 -262
- data/lib/pretentious/trigger.rb +30 -30
- data/lib/pretentious/version.rb +2 -1
- data/pretentious.gemspec +3 -0
- data/run_test.sh +1 -1
- data/spec/deconstructor_spec.rb +34 -20
- data/spec/fibonacci_spec.rb +7 -14
- data/spec/generator_spec.rb +1 -1
- data/spec/m_d5_spec.rb +3 -7
- data/spec/minitest_generator_spec.rb +2 -2
- data/spec/prententious_spec.rb +14 -4
- data/spec/spec_helper.rb +3 -1
- data/spec/test_class1_spec.rb +23 -38
- data/spec/test_class2_spec.rb +7 -16
- data/spec/test_class3_spec.rb +11 -18
- data/spec/test_class4_spec.rb +4 -7
- data/spec/test_class_for_auto_stub_spec.rb +5 -10
- data/spec/test_class_for_mocks_spec.rb +10 -19
- data/test/test_fibonacci.rb +72 -10
- data/test/test_m_d5.rb +4 -5
- data/test/test_meme.rb +6 -6
- data/test/test_test_class1.rb +36 -29
- data/test/test_test_class2.rb +16 -12
- data/test/test_test_class3.rb +15 -17
- data/test/test_test_class4.rb +6 -7
- data/test/test_test_class_for_mocks.rb +19 -16
- metadata +46 -4
data/test/test_test_class2.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
@@ -7,41 +7,45 @@ end
|
|
7
7
|
|
8
8
|
class TestClass2Scenario1 < TestClass2Test
|
9
9
|
def setup
|
10
|
-
|
10
|
+
@fixture = TestClass2.new('This is message 2', nil)
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_current_expectation
|
14
|
-
#TestClass2#print_message should return
|
14
|
+
# TestClass2#print_message should return
|
15
15
|
assert_nil @fixture.print_message
|
16
16
|
|
17
|
-
#TestClass2#print_message should return
|
17
|
+
# TestClass2#print_message should return
|
18
18
|
assert_nil @fixture.print_message
|
19
19
|
|
20
20
|
|
21
|
+
# TestClass2#print_message should return
|
22
|
+
assert_nil @fixture.print_message
|
23
|
+
|
24
|
+
# TestClass2#print_message should return
|
25
|
+
assert_nil @fixture.print_message
|
26
|
+
|
21
27
|
end
|
22
28
|
end
|
23
29
|
|
24
30
|
class TestClass2Scenario2 < TestClass2Test
|
25
31
|
def setup
|
26
|
-
|
32
|
+
@fixture = TestClass2.new('This is message 3', nil)
|
27
33
|
end
|
28
34
|
|
29
35
|
def test_current_expectation
|
30
|
-
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
34
39
|
class TestClass2Scenario3 < TestClass2Test
|
35
40
|
def setup
|
36
|
-
|
37
|
-
|
38
|
-
|
41
|
+
@message2 = 'This is message 3'
|
42
|
+
message = TestClass2.new(@message2, nil)
|
43
|
+
@fixture = TestClass2.new(message, @message2)
|
39
44
|
end
|
40
45
|
|
41
46
|
def test_current_expectation
|
42
|
-
#TestClass2#test when passed object = "This is message 3" should return This is message 3
|
43
|
-
assert_equal
|
44
|
-
|
47
|
+
# TestClass2#test when passed object = "This is message 3" should return This is message 3
|
48
|
+
assert_equal 'This is message 3', @fixture.test(@message2)
|
45
49
|
|
46
50
|
end
|
47
51
|
end
|
data/test/test_test_class3.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
@@ -7,34 +7,32 @@ end
|
|
7
7
|
|
8
8
|
class TestClass3Scenario1 < TestClass3Test
|
9
9
|
def setup
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
another_object = TestClass1.new('test')
|
11
|
+
var_13858160 = { 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_13858160)
|
13
|
+
testclass2 = TestClass2.new('This is message 2', nil)
|
14
|
+
@fixture = TestClass3.new(testclass1, testclass2)
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_current_expectation
|
18
|
-
#TestClass3#show_messages should return awesome!!!
|
19
|
-
assert_equal
|
20
|
-
|
18
|
+
# TestClass3#show_messages should return awesome!!!
|
19
|
+
assert_equal 'awesome!!!', @fixture.show_messages
|
21
20
|
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|
25
24
|
class TestClass3Scenario2 < TestClass3Test
|
26
25
|
def setup
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
another_object = TestClass1.new('test')
|
27
|
+
var_13858160 = { 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_13858160)
|
29
|
+
testclass2 = TestClass2.new('This is message 2', nil)
|
30
|
+
@fixture = TestClass3.new(testclass1, testclass2)
|
32
31
|
end
|
33
32
|
|
34
33
|
def test_current_expectation
|
35
|
-
#TestClass3#show_messages should return awesome!!!
|
36
|
-
assert_equal
|
37
|
-
|
34
|
+
# TestClass3#show_messages should return awesome!!!
|
35
|
+
assert_equal 'awesome!!!', @fixture.show_messages
|
38
36
|
|
39
37
|
end
|
40
38
|
end
|
data/test/test_test_class4.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
@@ -7,16 +7,15 @@ end
|
|
7
7
|
|
8
8
|
class TestClass4Scenario1 < TestClass4Test
|
9
9
|
def setup
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
var_8 = nil
|
11
|
+
var_13645460 = proc {
|
12
|
+
# Variable return values ... can't figure out what goes in here...
|
13
|
+
}
|
14
14
|
|
15
|
-
|
15
|
+
@fixture = TestClass4.new(&var_13645460)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_current_expectation
|
19
|
-
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'minitest_helper'
|
3
3
|
require "minitest/autorun"
|
4
4
|
|
@@ -7,25 +7,28 @@ end
|
|
7
7
|
|
8
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_11000660 = [2, 3, 4, 5]
|
15
15
|
|
16
|
-
TestMockSubClass.stub_any_instance(:test_method,
|
16
|
+
TestMockSubClass.stub_any_instance(:test_method, 'a return string') do
|
17
17
|
TestMockSubClass.stub_any_instance(:increment_val, 2) do
|
18
|
-
#TestClassForMocks#method_with_assign= when passed params2 = "test" should return test
|
19
|
-
assert_equal
|
18
|
+
# TestClassForMocks#method_with_assign= when passed params2 = "test" should return test
|
19
|
+
assert_equal 'test', @fixture.method_with_assign=('test')
|
20
20
|
|
21
|
-
#TestClassForMocks#method_with_usage should return a return string
|
22
|
-
assert_equal "a return string", @fixture.method_with_usage
|
23
21
|
|
24
|
-
#TestClassForMocks#
|
22
|
+
# TestClassForMocks#method_with_usage should return a return string
|
23
|
+
assert_equal 'a return string', @fixture.method_with_usage
|
24
|
+
|
25
|
+
|
26
|
+
# TestClassForMocks#method_with_usage2 should return [2, 3, 4, 5]
|
25
27
|
assert_equal [2, 3, 4, 5], @fixture.method_with_usage2
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
|
30
|
+
# TestClassForMocks#method_with_usage4 should return a return string
|
31
|
+
assert_equal 'a return string', @fixture.method_with_usage4
|
29
32
|
|
30
33
|
end
|
31
34
|
end
|
@@ -35,15 +38,15 @@ end
|
|
35
38
|
|
36
39
|
class TestClassForMocksScenario2 < TestClassForMocksTest
|
37
40
|
def setup
|
38
|
-
|
41
|
+
@fixture = TestClassForMocks.new
|
39
42
|
end
|
40
43
|
|
41
44
|
def test_current_expectation
|
42
|
-
|
45
|
+
var_19783300 = { val: 1, str: 'hello world', message: 'a message' }
|
43
46
|
|
44
|
-
TestMockSubClass.stub_any_instance(:return_hash,
|
45
|
-
#TestClassForMocks#method_with_usage3 when passed message = "a message" should return {:val=>1, :str=>"hello world", :message=>"a message"}
|
46
|
-
assert_equal
|
47
|
+
TestMockSubClass.stub_any_instance(:return_hash, var_19783300) do
|
48
|
+
# TestClassForMocks#method_with_usage3 when passed message = "a message" should return {:val=>1, :str=>"hello world", :message=>"a message"}
|
49
|
+
assert_equal var_19783300, @fixture.method_with_usage3('a message')
|
47
50
|
|
48
51
|
end
|
49
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Emmanuel Dayo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: binding_of_caller
|
@@ -108,6 +108,48 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.35'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.35'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec_junit_formatter
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.2.2
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.2.2
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
111
153
|
description: Characterization Tests for Ruby - Do you have a pretentious boss or dev
|
112
154
|
lead that pushes you to embrace tdd but for reasons hate it or them? here is a gem
|
113
155
|
to deal with that.
|
@@ -126,6 +168,7 @@ files:
|
|
126
168
|
- bin/ddtgen
|
127
169
|
- example.rb
|
128
170
|
- lib/pretentious.rb
|
171
|
+
- lib/pretentious/context.rb
|
129
172
|
- lib/pretentious/deconstructor.rb
|
130
173
|
- lib/pretentious/generator.rb
|
131
174
|
- lib/pretentious/generator_base.rb
|
@@ -180,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
223
|
version: '0'
|
181
224
|
requirements: []
|
182
225
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.4.8
|
184
227
|
signing_key:
|
185
228
|
specification_version: 4
|
186
229
|
summary: Characterization Tests generator for Ruby - Generate tests from existing/legacy
|
@@ -209,4 +252,3 @@ test_files:
|
|
209
252
|
- test/test_test_class3.rb
|
210
253
|
- test/test_test_class4.rb
|
211
254
|
- test/test_test_class_for_mocks.rb
|
212
|
-
has_rdoc:
|