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/spec/test_class2_spec.rb
CHANGED
@@ -1,50 +1,41 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe TestClass2 do
|
5
|
-
|
6
5
|
context 'Scenario 1' do
|
7
6
|
before do
|
8
|
-
@fixture = TestClass2.new(
|
7
|
+
@fixture = TestClass2.new('This is message 2', nil)
|
9
8
|
end
|
10
9
|
|
11
10
|
it 'should pass current expectations' do
|
12
|
-
|
13
11
|
# TestClass2#print_message should return
|
14
|
-
expect(
|
12
|
+
expect(@fixture.print_message).to be_nil
|
15
13
|
|
16
14
|
# TestClass2#print_message should return
|
17
|
-
expect(
|
18
|
-
|
15
|
+
expect(@fixture.print_message).to be_nil
|
19
16
|
end
|
20
|
-
|
21
17
|
end
|
22
18
|
|
23
19
|
context 'Scenario 2' do
|
24
20
|
before do
|
25
|
-
@fixture = TestClass2.new(
|
21
|
+
@fixture = TestClass2.new('This is message 3', nil)
|
26
22
|
end
|
27
23
|
|
28
24
|
it 'should pass current expectations' do
|
29
|
-
|
30
25
|
end
|
31
|
-
|
32
26
|
end
|
33
27
|
|
34
28
|
context 'Scenario 3' do
|
35
29
|
before do
|
36
|
-
@message2 =
|
30
|
+
@message2 = 'This is message 3'
|
37
31
|
message = TestClass2.new(@message2, nil)
|
38
32
|
@fixture = TestClass2.new(message, @message2)
|
39
33
|
end
|
40
34
|
|
41
35
|
it 'should pass current expectations' do
|
42
|
-
|
43
36
|
# TestClass2#test when passed object = "This is message 3" should return This is message 3
|
44
|
-
expect(
|
45
|
-
|
37
|
+
expect(@fixture.test(@message2)).to eq('This is message 3')
|
46
38
|
end
|
47
|
-
|
48
39
|
end
|
49
40
|
|
50
41
|
end
|
data/spec/test_class3_spec.rb
CHANGED
@@ -1,42 +1,35 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe TestClass3 do
|
5
|
-
|
6
5
|
context 'Scenario 1' do
|
7
6
|
before do
|
8
|
-
another_object = TestClass1.new(
|
9
|
-
|
10
|
-
testclass1 = TestClass1.new(
|
11
|
-
testclass2 = TestClass2.new(
|
7
|
+
another_object = TestClass1.new('test')
|
8
|
+
var_14488780 = { hello: 'world', test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: { yes: true, obj: another_object } }
|
9
|
+
testclass1 = TestClass1.new(var_14488780)
|
10
|
+
testclass2 = TestClass2.new('This is message 2', nil)
|
12
11
|
@fixture = TestClass3.new(testclass1, testclass2)
|
13
12
|
end
|
14
13
|
|
15
14
|
it 'should pass current expectations' do
|
16
|
-
|
17
15
|
# TestClass3#show_messages should return awesome!!!
|
18
|
-
expect(
|
19
|
-
|
16
|
+
expect(@fixture.show_messages).to eq('awesome!!!')
|
20
17
|
end
|
21
|
-
|
22
18
|
end
|
23
19
|
|
24
20
|
context 'Scenario 2' do
|
25
21
|
before do
|
26
|
-
another_object = TestClass1.new(
|
27
|
-
|
28
|
-
testclass1 = TestClass1.new(
|
29
|
-
testclass2 = TestClass2.new(
|
22
|
+
another_object = TestClass1.new('test')
|
23
|
+
var_14488780 = { hello: 'world', test: another_object, arr_1: [1, 2, 3, 4, 5, another_object], sub_hash: { yes: true, obj: another_object } }
|
24
|
+
testclass1 = TestClass1.new(var_14488780)
|
25
|
+
testclass2 = TestClass2.new('This is message 2', nil)
|
30
26
|
@fixture = TestClass3.new(testclass1, testclass2)
|
31
27
|
end
|
32
28
|
|
33
29
|
it 'should pass current expectations' do
|
34
|
-
|
35
30
|
# TestClass3#show_messages should return awesome!!!
|
36
|
-
expect(
|
37
|
-
|
31
|
+
expect(@fixture.show_messages).to eq('awesome!!!')
|
38
32
|
end
|
39
|
-
|
40
33
|
end
|
41
34
|
|
42
35
|
end
|
data/spec/test_class4_spec.rb
CHANGED
@@ -1,22 +1,19 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe TestClass4 do
|
5
|
-
|
6
5
|
context 'Scenario 1' do
|
7
6
|
before do
|
8
7
|
var_8 = nil
|
9
|
-
|
10
|
-
|
8
|
+
var_14420780 = proc {
|
9
|
+
# Variable return values ... can't figure out what goes in here...
|
11
10
|
}
|
12
11
|
|
13
|
-
@fixture = TestClass4.new(&
|
12
|
+
@fixture = TestClass4.new(&var_14420780)
|
14
13
|
end
|
15
14
|
|
16
15
|
it 'should pass current expectations' do
|
17
|
-
|
18
16
|
end
|
19
|
-
|
20
17
|
end
|
21
18
|
|
22
19
|
end
|
@@ -1,25 +1,20 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe TestClassForAutoStub do
|
5
|
-
|
6
5
|
context 'Scenario 1' do
|
7
6
|
before do
|
8
7
|
@fixture = TestClassForAutoStub.new
|
9
8
|
end
|
10
9
|
|
11
10
|
it 'should pass current expectations' do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
allow_any_instance_of(ClassUsedByTestClass).to receive(:stubbed_method).and_return("Hello Glorious world")
|
16
|
-
allow_any_instance_of(AnotherClassUsedByTestClass).to receive(:get_message).and_return("HI THERE!!!!")
|
11
|
+
var_20176100 = ['Hello Glorious world', 'HI THERE!!!!']
|
12
|
+
allow_any_instance_of(ClassUsedByTestClass).to receive(:stubbed_method).and_return('Hello Glorious world')
|
13
|
+
allow_any_instance_of(AnotherClassUsedByTestClass).to receive(:get_message).and_return('HI THERE!!!!')
|
17
14
|
|
18
15
|
# TestClassForAutoStub#method_that_uses_the_class_to_stub should return ["Hello Glorious world", "HI THERE!!!!"]
|
19
|
-
expect(
|
20
|
-
|
16
|
+
expect(@fixture.method_that_uses_the_class_to_stub).to eq(["Hello Glorious world", "HI THERE!!!!"])
|
21
17
|
end
|
22
|
-
|
23
18
|
end
|
24
19
|
|
25
20
|
end
|
@@ -1,34 +1,29 @@
|
|
1
|
-
#This file was automatically generated by the pretentious gem
|
1
|
+
# This file was automatically generated by the pretentious gem
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
RSpec.describe TestClassForMocks do
|
5
|
-
|
6
5
|
context 'Scenario 1' do
|
7
6
|
before do
|
8
7
|
@fixture = TestClassForMocks.new
|
9
8
|
end
|
10
9
|
|
11
10
|
it 'should pass current expectations' do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
allow_any_instance_of(TestMockSubClass).to receive(:test_method).and_return("a return string")
|
11
|
+
var_12850500 = [2, 3, 4, 5]
|
12
|
+
allow_any_instance_of(TestMockSubClass).to receive(:test_method).and_return('a return string')
|
16
13
|
allow_any_instance_of(TestMockSubClass).to receive(:increment_val).and_return(2, 3, 4, 5)
|
17
14
|
|
18
15
|
# TestClassForMocks#method_with_assign= when passed params2 = "test" should return test
|
19
|
-
expect(
|
16
|
+
expect(@fixture.method_with_assign=('test')).to eq('test')
|
20
17
|
|
21
18
|
# TestClassForMocks#method_with_usage should return a return string
|
22
|
-
expect(
|
19
|
+
expect(@fixture.method_with_usage).to eq('a return string')
|
23
20
|
|
24
21
|
# TestClassForMocks#method_with_usage2 should return [2, 3, 4, 5]
|
25
|
-
expect(
|
22
|
+
expect(@fixture.method_with_usage2).to eq([2, 3, 4, 5])
|
26
23
|
|
27
24
|
# TestClassForMocks#method_with_usage4 should return a return string
|
28
|
-
expect(
|
29
|
-
|
25
|
+
expect(@fixture.method_with_usage4).to eq('a return string')
|
30
26
|
end
|
31
|
-
|
32
27
|
end
|
33
28
|
|
34
29
|
context 'Scenario 2' do
|
@@ -37,16 +32,12 @@ RSpec.describe TestClassForMocks do
|
|
37
32
|
end
|
38
33
|
|
39
34
|
it 'should pass current expectations' do
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
allow_any_instance_of(TestMockSubClass).to receive(:return_hash).and_return(var_2169409740)
|
35
|
+
var_12706260 = { val: 1, str: 'hello world', message: 'a message' }
|
36
|
+
allow_any_instance_of(TestMockSubClass).to receive(:return_hash).and_return(var_12706260)
|
44
37
|
|
45
38
|
# TestClassForMocks#method_with_usage3 when passed message = "a message" should return {:val=>1, :str=>"hello world", :message=>"a message"}
|
46
|
-
expect(
|
47
|
-
|
39
|
+
expect(@fixture.method_with_usage3('a message')).to eq(var_12706260)
|
48
40
|
end
|
49
|
-
|
50
41
|
end
|
51
42
|
|
52
43
|
end
|
data/test/test_fibonacci.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,7 +7,7 @@ end
|
|
7
7
|
|
8
8
|
class FibonacciScenario1 < FibonacciTest
|
9
9
|
def setup
|
10
|
-
|
10
|
+
@fixture = Fibonacci.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_current_expectation
|
@@ -17,30 +17,92 @@ class FibonacciScenario1 < FibonacciTest
|
|
17
17
|
n_3 = 4
|
18
18
|
n_4 = 5
|
19
19
|
|
20
|
-
#Fibonacci#fib when passed n = 1 should return 1
|
20
|
+
# Fibonacci#fib when passed n = 1 should return 1
|
21
21
|
assert_equal 1, @fixture.fib(n)
|
22
22
|
|
23
|
-
#Fibonacci#fib when passed n = 2 should return 1
|
23
|
+
# Fibonacci#fib when passed n = 2 should return 1
|
24
24
|
assert_equal 1, @fixture.fib(n_1)
|
25
25
|
|
26
|
-
#Fibonacci#fib when passed n = 3 should return 2
|
26
|
+
# Fibonacci#fib when passed n = 3 should return 2
|
27
27
|
assert_equal 2, @fixture.fib(n_2)
|
28
28
|
|
29
|
-
#Fibonacci#fib when passed n = 4 should return 3
|
29
|
+
# Fibonacci#fib when passed n = 4 should return 3
|
30
30
|
assert_equal 3, @fixture.fib(n_3)
|
31
31
|
|
32
|
-
#Fibonacci#fib when passed n = 5 should return 5
|
32
|
+
# Fibonacci#fib when passed n = 5 should return 5
|
33
33
|
assert_equal 5, @fixture.fib(n_4)
|
34
34
|
|
35
35
|
|
36
|
+
# Fibonacci#fib when passed n = 1 should return 1
|
37
|
+
assert_equal 1, @fixture.fib(n)
|
38
|
+
|
39
|
+
# Fibonacci#fib when passed n = 2 should return 1
|
40
|
+
assert_equal 1, @fixture.fib(n_1)
|
41
|
+
|
42
|
+
# Fibonacci#fib when passed n = 3 should return 2
|
43
|
+
assert_equal 2, @fixture.fib(n_2)
|
44
|
+
|
45
|
+
# Fibonacci#fib when passed n = 4 should return 3
|
46
|
+
assert_equal 3, @fixture.fib(n_3)
|
47
|
+
|
48
|
+
# Fibonacci#fib when passed n = 5 should return 5
|
49
|
+
assert_equal 5, @fixture.fib(n_4)
|
50
|
+
|
51
|
+
|
52
|
+
# Fibonacci#fib when passed n = 1 should return 1
|
53
|
+
assert_equal 1, @fixture.fib(n)
|
54
|
+
|
55
|
+
# Fibonacci#fib when passed n = 2 should return 1
|
56
|
+
assert_equal 1, @fixture.fib(n_1)
|
57
|
+
|
58
|
+
# Fibonacci#fib when passed n = 3 should return 2
|
59
|
+
assert_equal 2, @fixture.fib(n_2)
|
60
|
+
|
61
|
+
# Fibonacci#fib when passed n = 4 should return 3
|
62
|
+
assert_equal 3, @fixture.fib(n_3)
|
63
|
+
|
64
|
+
# Fibonacci#fib when passed n = 5 should return 5
|
65
|
+
assert_equal 5, @fixture.fib(n_4)
|
66
|
+
|
67
|
+
|
68
|
+
# Fibonacci#fib when passed n = 1 should return 1
|
69
|
+
assert_equal 1, @fixture.fib(n)
|
70
|
+
|
71
|
+
# Fibonacci#fib when passed n = 2 should return 1
|
72
|
+
assert_equal 1, @fixture.fib(n_1)
|
73
|
+
|
74
|
+
# Fibonacci#fib when passed n = 3 should return 2
|
75
|
+
assert_equal 2, @fixture.fib(n_2)
|
76
|
+
|
77
|
+
# Fibonacci#fib when passed n = 4 should return 3
|
78
|
+
assert_equal 3, @fixture.fib(n_3)
|
79
|
+
|
80
|
+
# Fibonacci#fib when passed n = 5 should return 5
|
81
|
+
assert_equal 5, @fixture.fib(n_4)
|
82
|
+
|
83
|
+
|
84
|
+
# Fibonacci#fib when passed n = 1 should return 1
|
85
|
+
assert_equal 1, @fixture.fib(n)
|
86
|
+
|
87
|
+
# Fibonacci#fib when passed n = 2 should return 1
|
88
|
+
assert_equal 1, @fixture.fib(n_1)
|
89
|
+
|
90
|
+
# Fibonacci#fib when passed n = 3 should return 2
|
91
|
+
assert_equal 2, @fixture.fib(n_2)
|
92
|
+
|
93
|
+
# Fibonacci#fib when passed n = 4 should return 3
|
94
|
+
assert_equal 3, @fixture.fib(n_3)
|
95
|
+
|
96
|
+
# Fibonacci#fib when passed n = 5 should return 5
|
97
|
+
assert_equal 5, @fixture.fib(n_4)
|
98
|
+
|
36
99
|
end
|
37
100
|
end
|
38
101
|
|
39
102
|
class FibonacciScenario2 < FibonacciTest
|
40
103
|
def test_current_expectation
|
41
|
-
#Fibonacci::say_hello should return hello
|
42
|
-
assert_equal
|
43
|
-
|
104
|
+
# Fibonacci::say_hello should return hello
|
105
|
+
assert_equal 'hello', Fibonacci.say_hello
|
44
106
|
|
45
107
|
end
|
46
108
|
|
data/test/test_m_d5.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,11 +7,10 @@ end
|
|
7
7
|
|
8
8
|
class Digest::MD5Scenario1 < Digest::MD5Test
|
9
9
|
def test_current_expectation
|
10
|
-
sample =
|
11
|
-
|
12
|
-
#Digest::MD5::hexdigest when passed "This is the digest" should return 9f12248dcddeda976611d192efaaf72a
|
13
|
-
assert_equal "9f12248dcddeda976611d192efaaf72a", Digest::MD5.hexdigest(sample)
|
10
|
+
sample = 'This is the digest'
|
14
11
|
|
12
|
+
# Digest::MD5::hexdigest when passed "This is the digest" should return 9f12248dcddeda976611d192efaaf72a
|
13
|
+
assert_equal '9f12248dcddeda976611d192efaaf72a', Digest::MD5.hexdigest(sample)
|
15
14
|
|
16
15
|
end
|
17
16
|
|
data/test/test_meme.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,16 @@ end
|
|
7
7
|
|
8
8
|
class MemeScenario1 < MemeTest
|
9
9
|
def setup
|
10
|
-
|
10
|
+
@fixture = Meme.new
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_current_expectation
|
14
|
-
#Meme#i_can_has_cheezburger? should return OHAI!
|
15
|
-
assert_equal
|
14
|
+
# Meme#i_can_has_cheezburger? should return OHAI!
|
15
|
+
assert_equal 'OHAI!', @fixture.i_can_has_cheezburger?
|
16
16
|
|
17
|
-
#Meme#will_it_blend? should return YES!
|
18
|
-
assert_equal "YES!", @fixture.will_it_blend?
|
19
17
|
|
18
|
+
# Meme#will_it_blend? should return YES!
|
19
|
+
assert_equal 'YES!', @fixture.will_it_blend?
|
20
20
|
|
21
21
|
end
|
22
22
|
end
|
data/test/test_test_class1.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,83 +7,90 @@ end
|
|
7
7
|
|
8
8
|
class TestClass1Scenario1 < TestClass1Test
|
9
9
|
def setup
|
10
|
-
|
10
|
+
@fixture = TestClass1.new('test')
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_current_expectation
|
14
|
-
#TestClass1#message should return test
|
15
|
-
assert_equal
|
16
|
-
|
14
|
+
# TestClass1#message should return test
|
15
|
+
assert_equal 'test', @fixture.message
|
17
16
|
|
18
17
|
end
|
19
18
|
end
|
20
19
|
|
21
20
|
class TestClass1Scenario2 < TestClass1Test
|
22
21
|
def setup
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
@another_object = TestClass1.new('test')
|
23
|
+
@message = { hello: 'world', test: @another_object, arr_1: [1, 2, 3, 4, 5, @another_object], sub_hash: { yes: true, obj: @another_object } }
|
24
|
+
@fixture = TestClass1.new(@message)
|
26
25
|
end
|
27
26
|
|
28
27
|
def test_current_expectation
|
29
|
-
|
30
|
-
|
28
|
+
var_13631520 = proc { |message|
|
29
|
+
@message
|
31
30
|
}
|
32
31
|
|
33
32
|
test_class1 = nil
|
34
|
-
|
35
|
-
|
33
|
+
var_13617120 = proc {
|
34
|
+
# Variable return values ... can't figure out what goes in here...
|
36
35
|
}
|
37
36
|
|
38
37
|
|
39
|
-
#TestClass1#print_message should return
|
38
|
+
# TestClass1#print_message should return
|
39
|
+
assert_nil @fixture.print_message
|
40
|
+
|
41
|
+
# TestClass1#print_message should return
|
40
42
|
assert_nil @fixture.print_message
|
41
43
|
|
42
|
-
|
44
|
+
|
45
|
+
# TestClass1#print_message should return
|
43
46
|
assert_nil @fixture.print_message
|
44
47
|
|
45
|
-
#TestClass1#
|
46
|
-
|
48
|
+
# TestClass1#print_message should return
|
49
|
+
assert_nil @fixture.print_message
|
50
|
+
|
51
|
+
|
52
|
+
# TestClass1#set_block should return #<Pretentious::RecordedProc:0x000000019f91f0@example.rb:73>
|
53
|
+
assert_equal var_13631520, @fixture.set_block( &var_13631520)
|
47
54
|
|
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
55
|
|
51
|
-
#TestClass1#
|
56
|
+
# TestClass1#call_block should return {:hello=>"world", :test=>#<TestClass1:0x00000001a71d30 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={13864900=>"message"}>, :arr_1=>[1, 2, 3, 4, 5, #<TestClass1:0x00000001a71d30 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={13864900=>"message"}>], :sub_hash=>{:yes=>true, :obj=>#<TestClass1:0x00000001a71d30 @message="test", @_init_arguments={:params=>["test"], :params_types=>[[:req, :message]]}, @_variable_names={13864900=>"message"}>}}
|
57
|
+
assert_equal @message, @fixture.call_block( &var_13617120)
|
58
|
+
|
59
|
+
|
60
|
+
# TestClass1#something_is_wrong should return StandardError
|
52
61
|
assert_raises(StandardError) { @fixture.something_is_wrong }
|
53
62
|
|
54
|
-
#TestClass1#just_returns_true should return true
|
55
|
-
assert @fixture.just_returns_true
|
56
63
|
|
64
|
+
# TestClass1#just_returns_true should return true
|
65
|
+
assert @fixture.just_returns_true
|
57
66
|
|
58
67
|
end
|
59
68
|
end
|
60
69
|
|
61
70
|
class TestClass1Scenario3 < TestClass1Test
|
62
71
|
def setup
|
63
|
-
|
72
|
+
@fixture = TestClass1.new('Hello')
|
64
73
|
end
|
65
74
|
|
66
75
|
def test_current_expectation
|
67
|
-
another_object = TestClass1.new(
|
76
|
+
another_object = TestClass1.new('test')
|
68
77
|
|
69
|
-
#TestClass1#return_self when passed message = #<TestClass1:
|
78
|
+
# TestClass1#return_self when passed message = #<TestClass1:0x00000001a71d30> should return #<TestClass1:0x00000001a71d30>
|
70
79
|
assert_equal another_object, @fixture.return_self(another_object)
|
71
80
|
|
72
|
-
|
73
81
|
end
|
74
82
|
end
|
75
83
|
|
76
84
|
class TestClass1Scenario4 < TestClass1Test
|
77
85
|
def setup
|
78
|
-
|
79
|
-
|
86
|
+
@message = TestClass1.new('test')
|
87
|
+
@fixture = TestClass1.new(@message)
|
80
88
|
end
|
81
89
|
|
82
90
|
def test_current_expectation
|
83
|
-
#TestClass1#message should return #<TestClass1:
|
91
|
+
# TestClass1#message should return #<TestClass1:0x00000001a71d30>
|
84
92
|
assert_equal @message, @fixture.message
|
85
93
|
|
86
|
-
|
87
94
|
end
|
88
95
|
end
|
89
96
|
|