@@ -23,8 +23,9 @@ def fake_xcodes(*names)
23
23
end
24
24
25
25
def fake_installed_xcode ( name )
26
- xcode_path = "/Applications/Xcode-#{ name } .app"
27
- xcode_version = name
26
+ installed_name = name . split ( ' ' ) . join ( '.' )
27
+ xcode_path = "/Applications/Xcode-#{ installed_name } .app"
28
+ xcode_version = name . split ( ' ' ) . first
28
29
xcode_version << '.0' unless name . include? '.'
29
30
30
31
installed_xcode = InstalledXcode . new ( xcode_path )
@@ -49,9 +50,21 @@ def fake_installed_xcodes(*names)
49
50
describe '#list_annotated' do
50
51
it 'lists all versions with annotations' do
51
52
fake_xcodes '1' , '2.3' , '2.3.1' , '2.3.2' , '3 some' , '4.3.1 for Lion' , '9.4.1' , '10 beta'
52
- fake_installed_xcodes '2.3' , '4.3.1' , '10'
53
+ fake_installed_xcodes '2.3' , '4.3.1 for Lion ' , '10 beta '
53
54
installer . list . should == "1\n 2.3 (installed)\n 2.3.1\n 2.3.2\n 3 some\n 4.3.1 for Lion (installed)\n 9.4.1\n 10 beta (installed)"
54
55
end
56
+
57
+ it 'distinguish between beta and official_version' do
58
+ fake_xcodes '11.4' , '11.4 beta'
59
+ fake_installed_xcodes '11.4'
60
+ installer . list . should == "11.4 (installed)\n 11.4 beta"
61
+ end
62
+
63
+ it 'distinguish each beta versions' do
64
+ fake_xcodes '11.4 beta' , '11.4 beta 3'
65
+ fake_installed_xcodes '11.4 beta'
66
+ installer . list . should == "11.4 beta (installed)\n 11.4 beta 3"
67
+ end
55
68
end
56
69
end
57
70
end
0 commit comments