Skip to content

Commit 5a7029c

Browse files
committed
Add more skippability to rspec
1 parent df838ba commit 5a7029c

9 files changed

+20
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
- `keepachangelog_manager` gem to begin streamlining the release process
1414
- `unittest_setup()` and `unittest_teardown()` macros, my thanks to @hlovdal for contributing this code
1515
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS` (for `arduino_ci` gem hackers)
16+
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS` (for `arduino_ci` gem hackers)
17+
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_CPP_RSPEC_TESTS` (for `arduino_ci` gem hackers)
1618

1719
### Changed
1820
- Unit tests and examples are now executed alphabetically by filename

spec/arduino_ci_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "spec_helper"
22

33
RSpec.describe ArduinoCI do
4+
next if skip_ruby_tests
45
context "gem" do
56
it "has a version number" do
67
expect(ArduinoCI::VERSION).not_to be nil
@@ -9,6 +10,7 @@
910
end
1011

1112
RSpec.describe ArduinoCI::Host do
13+
next if skip_ruby_tests
1214
context "which" do
1315
it "can find things with which" do
1416
ruby_path = ArduinoCI::Host.which("ruby")

spec/arduino_cmd_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def get_sketch(dir, file)
77

88

99
RSpec.describe ArduinoCI::ArduinoCmd do
10+
next if skip_ruby_tests
1011
next if skip_splash_screen_tests
1112

1213
arduino_cmd = ArduinoCI::ArduinoInstallation.autolocate!

spec/arduino_downloader_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
DESIRED_VERSION = "rhubarb"
44
RSpec.describe ArduinoCI::ArduinoDownloader do
5+
next if skip_ruby_tests
56
context "Basics" do
67
it "has correct class properties" do
78
ad = ArduinoCI::ArduinoDownloader
@@ -24,6 +25,7 @@
2425
end
2526

2627
RSpec.describe ArduinoCI::ArduinoDownloaderLinux do
28+
next if skip_ruby_tests
2729
context "Basics" do
2830
it "has correct class properties" do
2931
ad = ArduinoCI::ArduinoDownloaderLinux
@@ -49,6 +51,7 @@
4951
end
5052

5153
RSpec.describe ArduinoCI::ArduinoDownloaderOSX do
54+
next if skip_ruby_tests
5255
context "Basics" do
5356
it "has correct class properties" do
5457
ad = ArduinoCI::ArduinoDownloaderOSX

spec/arduino_installation_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "spec_helper"
22

33
RSpec.describe ArduinoCI::ArduinoInstallation do
4+
next if skip_ruby_tests
45
next if skip_splash_screen_tests
56

67
context "autolocate" do

spec/ci_config_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require "pathname"
33

44
RSpec.describe ArduinoCI::CIConfig do
5+
next if skip_ruby_tests
56
context "default" do
67
it "loads from yaml" do
78
default_config = ArduinoCI::CIConfig.default

spec/cpp_library_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_relative_dir(sampleprojects_tests_dir)
1111
end
1212

1313
RSpec.describe ArduinoCI::CppLibrary do
14+
next if skip_ruby_tests
1415
cpp_lib_path = sampleproj_path + "DoSomething"
1516
cpp_library = ArduinoCI::CppLibrary.new(cpp_lib_path, Pathname.new("my_fake_arduino_lib_dir"))
1617
context "cpp_files" do

spec/spec_helper.rb

+8
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@
1616
def skip_splash_screen_tests
1717
!ENV["ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS"].nil?
1818
end
19+
20+
def skip_ruby_tests
21+
!ENV["ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS"].nil?
22+
end
23+
24+
def skip_cpp_tests
25+
!ENV["ARDUINO_CI_SKIP_CPP_RSPEC_TESTS"].nil?
26+
end

spec/testsomething_unittests_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def get_relative_dir(sampleprojects_tests_dir)
1111
end
1212

1313
RSpec.describe "TestSomething C++" do
14+
next if skip_cpp_tests
1415
cpp_lib_path = sampleproj_path + "TestSomething"
1516
cpp_library = ArduinoCI::CppLibrary.new(cpp_lib_path, Pathname.new("my_fake_arduino_lib_dir"))
1617
context "cpp_files" do

0 commit comments

Comments
 (0)