- Notifications
You must be signed in to change notification settings - Fork 34
/
Copy patharduino_downloader_spec.rb
95 lines (80 loc) · 3.29 KB
/
arduino_downloader_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
require"spec_helper"
DESIRED_VERSION="rhubarb"
RSpec.describeArduinoCI::ArduinoDownloaderdo
nextifskip_ruby_tests
context"Basics"do
it"has correct class properties"do
ad=ArduinoCI::ArduinoDownloader
expect{ad.extracted_file}.toraise_error(NotImplementedError)
expect{ad.extractor}.toraise_error(NotImplementedError)
expect{ad.extract("foo")}.toraise_error(NotImplementedError)
end
it"has correct instance properties"do
ad=ArduinoCI::ArduinoDownloader.new(DESIRED_VERSION)
expect(ad.prepare).tobenil
expect{ad.package_file}.toraise_error(NotImplementedError)
end
end
end
RSpec.describeArduinoCI::ArduinoDownloaderLinuxdo
nextifskip_ruby_tests
context"Basics"do
it"has correct class properties"do
ad=ArduinoCI::ArduinoDownloaderLinux
# these can vary with CI. Don't test them.
# expect(ad.existing_executable).to be nil
# expect(ad.autolocated_executable).to be nil
# expect(ad.force_installed_executable).to be nil
expect(ad.downloader).toeq("open-uri")
expect(ad.extractor).toeq("tar")
end
it"has correct instance properties"do
ad=ArduinoCI::ArduinoDownloaderLinux.new(DESIRED_VERSION)
expect(ad.prepare).tobenil
expect(ad.package_url).toeq("https://github.com/arduino/arduino-cli/releases/download/rhubarb/arduino-cli_rhubarb_Linux_64bit.tar.gz")
expect(ad.package_file).toeq("arduino-cli_rhubarb_Linux_64bit.tar.gz")
end
end
end
RSpec.describeArduinoCI::ArduinoDownloaderOSXdo
nextifskip_ruby_tests
context"Basics"do
it"has correct class properties"do
ad=ArduinoCI::ArduinoDownloaderOSX
# these can vary with CI. Don't test them.
# expect(ad.existing_executable).to be nil
# expect(ad.autolocated_executable).to be nil
# expect(ad.force_installed_executable).to be nil
expect(ad.downloader).toeq("open-uri")
expect(ad.extractor).toeq("tar")
end
it"has correct instance properties"do
ad=ArduinoCI::ArduinoDownloaderOSX.new(DESIRED_VERSION)
expect(ad.prepare).tobenil
expect(ad.package_url).toeq("https://github.com/arduino/arduino-cli/releases/download/rhubarb/arduino-cli_rhubarb_macOS_64bit.tar.gz")
expect(ad.package_file).toeq("arduino-cli_rhubarb_macOS_64bit.tar.gz")
end
end
end
ifArduinoCI::Host.os == :windows
RSpec.describeArduinoCI::ArduinoDownloaderWindowsdo
nextifskip_ruby_tests
context"Basics"do
it"has correct class properties"do
ad=ArduinoCI::ArduinoDownloaderWindows
# these will vary with CI. Don't test them.
# expect(ad.autolocated_executable).to be nil
# expect(ad.existing_executable).to be nil
# expect(ad.force_installed_executable).to be nil
expect(ad.downloader).toeq("open-uri")
expect(ad.extractor).toeq("Expand-Archive")
end
it"has correct instance properties"do
ad=ArduinoCI::ArduinoDownloaderWindows.new(DESIRED_VERSION)
expect(ad.prepare).tobenil
expect(ad.package_url).toeq("https://github.com/arduino/arduino-cli/releases/download/rhubarb/arduino-cli_rhubarb_Windows_64bit.zip")
expect(ad.package_file).toeq("arduino-cli_rhubarb_Windows_64bit.zip")
end
end
end
end