File tree Expand file tree Collapse file tree 4 files changed +3
-4
lines changed Expand file tree Collapse file tree 4 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def to_python(object)
2828 case object
2929 when true then 'True'
3030 when false then 'False'
31- when :undef then 'None'
31+ when nil then 'None'
3232 when Array then "[#{ object . map { |x | to_python ( x ) } . join ( ', ' ) } ]"
3333 when Hash then "{#{ object . map { |k , v | "#{ to_python ( k ) } : #{ to_python ( v ) } " } . join ( ', ' ) } }"
3434 else object . inspect
Original file line number Diff line number Diff line change 2626 # The String representation of the object
2727 def to_ruby ( object )
2828 case object
29- when :undef then 'nil'
3029 when Array then "[#{ object . map { |x | to_ruby ( x ) } . join ( ', ' ) } ]"
3130 when Hash then "{#{ object . map { |k , v | "#{ to_ruby ( k ) } => #{ to_ruby ( v ) } " } . join ( ', ' ) } }"
3231 else object . inspect
Original file line number Diff line number Diff line change 55describe 'to_python' do
66 it { is_expected . not_to eq ( nil ) }
77 it { is_expected . to run . with_params ( '' ) . and_return ( '""' ) }
8- it { is_expected . to run . with_params ( :undef ) . and_return ( 'None' ) }
8+ it { is_expected . to run . with_params ( nil ) . and_return ( 'None' ) }
99 it { is_expected . to run . with_params ( true ) . and_return ( 'True' ) }
1010 it { is_expected . to run . with_params ( false ) . and_return ( 'False' ) }
1111 it { is_expected . to run . with_params ( 'one' ) . and_return ( '"one"' ) }
Original file line number Diff line number Diff line change 55describe 'to_ruby' do
66 it { is_expected . not_to eq ( nil ) }
77 it { is_expected . to run . with_params ( '' ) . and_return ( '""' ) }
8- it { is_expected . to run . with_params ( :undef ) . and_return ( 'nil' ) }
8+ it { is_expected . to run . with_params ( nil ) . and_return ( 'nil' ) }
99 it { is_expected . to run . with_params ( true ) . and_return ( 'true' ) }
1010 it { is_expected . to run . with_params ( 'one' ) . and_return ( '"one"' ) }
1111 it { is_expected . to run . with_params ( 42 ) . and_return ( '42' ) }
You can’t perform that action at this time.
0 commit comments