Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add more skippability to rspec
  • Loading branch information
ianfixes committed Jan 29, 2019
commit 5a7029c4716c9bf6f7e0b027cabb23608210ecbe
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `keepachangelog_manager` gem to begin streamlining the release process
- `unittest_setup()` and `unittest_teardown()` macros, my thanks to @hlovdal for contributing this code
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS` (for `arduino_ci` gem hackers)
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS` (for `arduino_ci` gem hackers)
- Added rspec sensitivity to the environment variable `$ARDUINO_CI_SKIP_CPP_RSPEC_TESTS` (for `arduino_ci` gem hackers)

### Changed
- Unit tests and examples are now executed alphabetically by filename
Expand Down
2 changes: 2 additions & 0 deletions spec/arduino_ci_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "spec_helper"

RSpec.describe ArduinoCI do
next if skip_ruby_tests
context "gem" do
it "has a version number" do
expect(ArduinoCI::VERSION).not_to be nil
Expand All @@ -9,6 +10,7 @@
end

RSpec.describe ArduinoCI::Host do
next if skip_ruby_tests
context "which" do
it "can find things with which" do
ruby_path = ArduinoCI::Host.which("ruby")
Expand Down
1 change: 1 addition & 0 deletions spec/arduino_cmd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def get_sketch(dir, file)


RSpec.describe ArduinoCI::ArduinoCmd do
next if skip_ruby_tests
next if skip_splash_screen_tests

arduino_cmd = ArduinoCI::ArduinoInstallation.autolocate!
Expand Down
3 changes: 3 additions & 0 deletions spec/arduino_downloader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

DESIRED_VERSION = "rhubarb"
RSpec.describe ArduinoCI::ArduinoDownloader do
next if skip_ruby_tests
context "Basics" do
it "has correct class properties" do
ad = ArduinoCI::ArduinoDownloader
Expand All @@ -24,6 +25,7 @@
end

RSpec.describe ArduinoCI::ArduinoDownloaderLinux do
next if skip_ruby_tests
context "Basics" do
it "has correct class properties" do
ad = ArduinoCI::ArduinoDownloaderLinux
Expand All @@ -49,6 +51,7 @@
end

RSpec.describe ArduinoCI::ArduinoDownloaderOSX do
next if skip_ruby_tests
context "Basics" do
it "has correct class properties" do
ad = ArduinoCI::ArduinoDownloaderOSX
Expand Down
1 change: 1 addition & 0 deletions spec/arduino_installation_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "spec_helper"

RSpec.describe ArduinoCI::ArduinoInstallation do
next if skip_ruby_tests
next if skip_splash_screen_tests

context "autolocate" do
Expand Down
1 change: 1 addition & 0 deletions spec/ci_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require "pathname"

RSpec.describe ArduinoCI::CIConfig do
next if skip_ruby_tests
context "default" do
it "loads from yaml" do
default_config = ArduinoCI::CIConfig.default
Expand Down
1 change: 1 addition & 0 deletions spec/cpp_library_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def get_relative_dir(sampleprojects_tests_dir)
end

RSpec.describe ArduinoCI::CppLibrary do
next if skip_ruby_tests
cpp_lib_path = sampleproj_path + "DoSomething"
cpp_library = ArduinoCI::CppLibrary.new(cpp_lib_path, Pathname.new("my_fake_arduino_lib_dir"))
context "cpp_files" do
Expand Down
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@
def skip_splash_screen_tests
!ENV["ARDUINO_CI_SKIP_SPLASH_SCREEN_RSPEC_TESTS"].nil?
end

def skip_ruby_tests
!ENV["ARDUINO_CI_SKIP_RUBY_RSPEC_TESTS"].nil?
end

def skip_cpp_tests
!ENV["ARDUINO_CI_SKIP_CPP_RSPEC_TESTS"].nil?
end
1 change: 1 addition & 0 deletions spec/testsomething_unittests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def get_relative_dir(sampleprojects_tests_dir)
end

RSpec.describe "TestSomething C++" do
next if skip_cpp_tests
cpp_lib_path = sampleproj_path + "TestSomething"
cpp_library = ArduinoCI::CppLibrary.new(cpp_lib_path, Pathname.new("my_fake_arduino_lib_dir"))
context "cpp_files" do
Expand Down