@@ -68,36 +68,39 @@ module Glue
68
68
69
69
define_steps do
70
70
When ( 'an object is logged' ) do
71
- log ( a : 1 , b : 2 , c : 3 )
71
+ object = Object . new
72
+ def object . to_s
73
+ '<test-object>'
74
+ end
75
+ log ( object )
72
76
end
73
77
end
74
78
75
- it 'attached the styring version on the object' do
76
- expect ( @out . string ) . to include '{:a=>1, :b=>2, :c=>3}'
79
+ it 'prints the stringified version of the object as a log message ' do
80
+ expect ( @out . string ) . to include ( '<test-object>' )
77
81
end
78
82
end
79
83
80
84
describe 'when logging multiple items on one call' do
81
85
define_feature <<-FEATURE
82
- Feature: Banana party
86
+ Feature: Logging multiple entries
83
87
84
- Scenario: Monkey eats banana
85
- When monkey eats banana
88
+ Scenario: Logging multiple entries
89
+ When logging multiple entries
86
90
FEATURE
87
91
88
92
define_steps do
89
- When ( '{word} {word} {word} ' ) do | subject , verb , complement |
90
- log "subject: #{ subject } " , "verb: #{ verb } " , "complement: #{ complement } " , subject : subject , verb : verb , complement : complement
93
+ When ( 'logging multiple entries ' ) do
94
+ log 'entry one' , 'entry two' , 'entry three'
91
95
end
92
96
end
93
97
94
- it 'logs each parameter independently' do
95
- expect ( @out . string ) . to include [
96
- ' subject: monkey' ,
97
- ' verb: eats' ,
98
- ' complement: banana' ,
99
- ' {:subject=>"monkey", :verb=>"eats", :complement=>"banana"}'
100
- ] . join ( "\n " )
98
+ it 'logs each entry independently' do
99
+ expect ( @out . string ) . to include ( [
100
+ ' entry one' ,
101
+ ' entry two' ,
102
+ ' entry three'
103
+ ] . join ( "\n " ) )
101
104
end
102
105
end
103
106
0 commit comments