diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 901a8ae..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -service_name: travis-pro -repo_token: gNB8KeAdYQKNW2YC4uut6Zh2ToBnPyMqB diff --git a/.github/workflows/jruby.yml b/.github/workflows/jruby.yml index 5684b18..508aae7 100644 --- a/.github/workflows/jruby.yml +++ b/.github/workflows/jruby.yml @@ -11,6 +11,7 @@ on: - cron: "0 21 * * 6" env: + CI: "yes" JRUBY_OPTS: "--debug" jobs: @@ -39,3 +40,5 @@ jobs: bundler: latest bundler-cache: true - run: bundle exec rspec + - name: Upload coverage to Codecov + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 3f00fae..30b0baa 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -10,6 +10,9 @@ on: schedule: - cron: "0 21 * * 6" +env: + CI: "yes" + jobs: rspec: runs-on: ubuntu-24.04 @@ -17,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["3.1", "3.2", "3.3"] + ruby: ["3.1", "3.2", "3.3", "3.4"] steps: - name: Harden Runner @@ -36,3 +39,5 @@ jobs: bundler: latest bundler-cache: true - run: bundle exec rspec + - name: Upload coverage to Codecov + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 diff --git a/.gitignore b/.gitignore index f7385c6..f2f3a8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,13 @@ -*.gem -*.rbc -.bundle -.config -.yardoc -InstalledFiles -_yardoc -coverage -doc/ -lib/bundler/man -pkg -rdoc -spec/reports -test/tmp -test/version_tmp -tmp +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ + +# rspec failure tracking +.rspec_status + .idea/ diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..34c5164 --- /dev/null +++ b/.rspec @@ -0,0 +1,3 @@ +--format documentation +--color +--require spec_helper diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 0000000..72b2693 --- /dev/null +++ b/.standard.yml @@ -0,0 +1 @@ +ruby_version: 3.1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b92c928 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## main + +* Rename `errbit_plugin` to `errbit-ng-plugin` diff --git a/Gemfile b/Gemfile index 60ce057..4de0c26 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,12 @@ +# frozen_string_literal: true + source "https://rubygems.org" -# Specify your gem's dependencies in errbit_plugin.gemspec +# Specify your gem's dependencies in errbit-ng-plugin.gemspec gemspec +gem "rake" gem "rspec" -gem "coveralls", require: false gem "standard" +gem "simplecov" +gem "simplecov-cobertura", require: false diff --git a/Gemfile.lock b/Gemfile.lock index abec490..3dfd908 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,19 +1,12 @@ PATH remote: . specs: - errbit_plugin (0.6.0) + errbit-ng-plugin (0.1.0) GEM remote: https://rubygems.org/ specs: ast (2.4.2) - bigdecimal (3.1.9) - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) diff-lcs (1.5.1) docile (1.4.1) json (2.9.1) @@ -27,6 +20,7 @@ GEM rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) + rexml (3.4.0) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -56,11 +50,15 @@ GEM rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) - simplecov (0.16.1) + simplecov (0.22.0) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.13.1) + simplecov_json_formatter (0.1.4) standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) @@ -73,13 +71,6 @@ GEM standard-performance (1.6.0) lint_roller (~> 1.1) rubocop-performance (~> 1.23.0) - sync (0.5.0) - term-ansicolor (1.11.2) - tins (~> 1.0) - thor (1.3.2) - tins (1.38.0) - bigdecimal - sync unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) @@ -98,11 +89,11 @@ PLATFORMS x86_64-linux-musl DEPENDENCIES - bundler - coveralls - errbit_plugin! + errbit-ng-plugin! rake rspec + simplecov + simplecov-cobertura standard BUNDLED WITH diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 5ee0e75..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Errbit - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt index 1c950f2..da7552d 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,22 +1,23 @@ -Copyright (c) 2013 Cyril Mougel +The MIT License (MIT) -MIT License +Copyright (c) 2013 Errbit +Copyright (c) 2013 Cyril Mougel +Copyright (c) 2025 Errbit-NG Team -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index cbe1690..58699e1 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,13 @@ the class must extend ErrbitPlugin::IssueTracker. Here's an example: ```ruby class MyIssueTracker < ErrbitPlugin::IssueTracker - # A unique label for your tracker plugin used internally by errbit def self.label - 'my-tracker' + "my-tracker" end def self.note - 'a note about this tracker that users will see' + "a note about this tracker that users will see" end # Form fields that will be presented to the administrator when setting up @@ -60,9 +59,9 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # and the binary icon data. def self.icons @icons ||= { - create: [ 'image/png', File.read('./path/to/create.png') ], - goto: [ 'image/png', File.read('./path/to/goto.png') ], - inactive: [ 'image/png', File.read('./path/to/inactive.png') ], + create: ["image/png", File.read("./path/to/create.png")], + goto: ["image/png", File.read("./path/to/goto.png")], + inactive: ["image/png", File.read("./path/to/inactive.png")] } end @@ -80,7 +79,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker if options[:username] {} else - { field_one: 'username must be present' } + {field_one: "username must be present"} end end @@ -92,7 +91,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker def create_issue(title, body, user: {}) # Create an issue! Then update the problem to link it. - 'http://sometracker.com/my/issue/123' + "https://sometracker.com/my/issue/123" end # This method is optional. Errbit will create body text for your issue by @@ -107,7 +106,7 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # @see http://apidock.com/rails/ActionController/Base/render_to_string def render_body_args # In this example, we want to render a special file - ['/path/to/some/template', formats: [:rdoc]] + ["/path/to/some/template", formats: [:rdoc]] end # This method is optional, and is where you actually go close the issue on @@ -121,12 +120,15 @@ class MyIssueTracker < ErrbitPlugin::IssueTracker # The URL for your remote issue tracker def url - 'http://some-remote-tracker.com' + "https://some-remote-tracker.com" end end ``` ## Contributing -Discuss any changes you'd like to make with the authors on the mailing list, or -by opening a github issue. +Bug reports and pull requests are welcome on GitHub at https://github.com/errbit-ng/errbit-ng-plugin. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/Rakefile b/Rakefile index 2995527..b6ae734 100644 --- a/Rakefile +++ b/Rakefile @@ -1 +1,8 @@ +# frozen_string_literal: true + require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task default: :spec diff --git a/errbit-ng-plugin.gemspec b/errbit-ng-plugin.gemspec new file mode 100644 index 0000000..6347431 --- /dev/null +++ b/errbit-ng-plugin.gemspec @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +require_relative "lib/errbit_plugin/version" + +Gem::Specification.new do |spec| + spec.name = "errbit-ng-plugin" + spec.version = ErrbitPlugin::VERSION + spec.authors = ["Ihor Zubkov"] + spec.email = ["igor.zubkov@gmail.com"] + + spec.summary = "Base to create an Errbit-NG plugins" + spec.description = "Base to create an Errbit-NG plugins" + spec.homepage = "https://github.com/errbit-ng/errbit-ng-plugin" + spec.license = "MIT" + + spec.required_ruby_version = ">= 3.1.0" + + spec.metadata["rubygems_mfa_required"] = "true" + spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues" + spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md" + spec.metadata["documentation_uri"] = "#{spec.homepage}/blob/main/README.md" + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + gemspec = File.basename(__FILE__) + spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls| + ls.readlines("\x0", chomp: true).reject do |f| + (f == gemspec) || + f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile]) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] +end diff --git a/errbit_plugin.gemspec b/errbit_plugin.gemspec deleted file mode 100644 index 4e438c8..0000000 --- a/errbit_plugin.gemspec +++ /dev/null @@ -1,21 +0,0 @@ -lib = File.expand_path("../lib", __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "errbit_plugin/version" - -Gem::Specification.new do |spec| - spec.name = "errbit_plugin" - spec.version = ErrbitPlugin::VERSION - spec.authors = ["Stephen Crosby"] - spec.email = ["stevecrozz@gmail.com"] - spec.description = "Base to create an Errbit-NG plugins" - spec.summary = "Base to create an Errbit-NG plugins" - spec.homepage = "http://github.com/errbit-ng/errbit-ng-plugin" - spec.license = "MIT" - - spec.files = `git ls-files`.split($/) - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] - - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake" -end diff --git a/lib/errbit-ng-plugin.rb b/lib/errbit-ng-plugin.rb new file mode 100644 index 0000000..3c537d2 --- /dev/null +++ b/lib/errbit-ng-plugin.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require_relative "errbit_plugin" diff --git a/lib/errbit_plugin.rb b/lib/errbit_plugin.rb index fb7699b..f1cd222 100644 --- a/lib/errbit_plugin.rb +++ b/lib/errbit_plugin.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + require "errbit_plugin/version" require "errbit_plugin/registry" require "errbit_plugin/issue_tracker" require "errbit_plugin/validate_issue_tracker" -require "errbit_plugin/issue_trackers/none" +require "errbit_plugin/none_issue_tracker" diff --git a/lib/errbit_plugin/issue_tracker.rb b/lib/errbit_plugin/issue_tracker.rb index 83b5131..aaf9200 100644 --- a/lib/errbit_plugin/issue_tracker.rb +++ b/lib/errbit_plugin/issue_tracker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin # abstract class for issue trackers class IssueTracker diff --git a/lib/errbit_plugin/issue_trackers/none.rb b/lib/errbit_plugin/none_issue_tracker.rb similarity index 97% rename from lib/errbit_plugin/issue_trackers/none.rb rename to lib/errbit_plugin/none_issue_tracker.rb index b6c9991..9732b07 100644 --- a/lib/errbit_plugin/issue_trackers/none.rb +++ b/lib/errbit_plugin/none_issue_tracker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin class NoneIssueTracker < IssueTracker def self.label diff --git a/lib/errbit_plugin/registry.rb b/lib/errbit_plugin/registry.rb index ce6e909..857c2c9 100644 --- a/lib/errbit_plugin/registry.rb +++ b/lib/errbit_plugin/registry.rb @@ -1,17 +1,18 @@ -module ErrbitPlugin - class IncompatibilityError < StandardError; end +# frozen_string_literal: true - class AlreadyRegisteredError < StandardError; end +module ErrbitPlugin + class IncompatibilityError < StandardError + end - module Registry - @issue_trackers = {} + class AlreadyRegisteredError < StandardError + end + class Registry def self.add_issue_tracker(klass) key = klass.label if issue_trackers.has_key?(key) - raise AlreadyRegisteredError, - "issue_tracker '#{key}' already registered" + raise AlreadyRegisteredError, "issue_tracker '#{key}' already registered" end validate = ValidateIssueTracker.new(klass) @@ -28,7 +29,7 @@ def self.clear_issue_trackers end def self.issue_trackers - @issue_trackers + @issue_trackers ||= {} end end end diff --git a/lib/errbit_plugin/validate_issue_tracker.rb b/lib/errbit_plugin/validate_issue_tracker.rb index 13f7d88..53e917e 100644 --- a/lib/errbit_plugin/validate_issue_tracker.rb +++ b/lib/errbit_plugin/validate_issue_tracker.rb @@ -1,10 +1,13 @@ +# frozen_string_literal: true + module ErrbitPlugin class ValidateIssueTracker + attr_reader :errors + def initialize(klass) @klass = klass @errors = [] end - attr_reader :errors def valid? valid_inherit = good_inherit? @@ -21,6 +24,7 @@ def good_inherit? true else add_errors(:not_inherited) + false end end @@ -31,6 +35,7 @@ def implements_instance_methods? true else add_errors(:instance_method_missing, method) + false end end @@ -44,6 +49,7 @@ def implements_class_methods? true else add_errors(:class_method_missing, method) + false end end diff --git a/lib/errbit_plugin/version.rb b/lib/errbit_plugin/version.rb index 7d7fc95..d60c166 100644 --- a/lib/errbit_plugin/version.rb +++ b/lib/errbit_plugin/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module ErrbitPlugin - VERSION = "0.6.0" + VERSION = "0.1.0" end diff --git a/spec/errbit_plugin/registry_spec.rb b/spec/errbit_plugin/registry_spec.rb index f87e5fc..d798d96 100644 --- a/spec/errbit_plugin/registry_spec.rb +++ b/spec/errbit_plugin/registry_spec.rb @@ -1,18 +1,17 @@ +# frozen_string_literal: true + require "spec_helper" -describe ErrbitPlugin::Registry do - before do - ErrbitPlugin::Registry.clear_issue_trackers - end +RSpec.describe ErrbitPlugin::Registry do + before { ErrbitPlugin::Registry.clear_issue_trackers } - let(:tracker) { - tracker = Class.new(ErrbitPlugin::IssueTracker) do + let(:tracker) do + Class.new(ErrbitPlugin::IssueTracker) do def self.label "something" end end - tracker - } + end describe ".add_issue_tracker" do context "with issue_tracker class valid" do @@ -22,15 +21,19 @@ def self.label .with(tracker) .and_return(double(valid?: true, message: "")) end + it "add new issue_tracker plugin" do ErrbitPlugin::Registry.add_issue_tracker(tracker) + expect(ErrbitPlugin::Registry.issue_trackers).to eq({ "something" => tracker }) end + context "with already issue_tracker with this key" do it "raise ErrbitPlugin::AlreadyRegisteredError" do ErrbitPlugin::Registry.add_issue_tracker(tracker) + expect { ErrbitPlugin::Registry.add_issue_tracker(tracker) }.to raise_error(ErrbitPlugin::AlreadyRegisteredError) @@ -44,6 +47,7 @@ def self.label .to receive(:new) .with(tracker) .and_return(double(valid?: false, message: "foo", errors: [])) + expect { ErrbitPlugin::Registry.add_issue_tracker(tracker) }.to raise_error(ErrbitPlugin::IncompatibilityError) diff --git a/spec/errbit_plugin/validate_issue_tracker_spec.rb b/spec/errbit_plugin/validate_issue_tracker_spec.rb index 1a788e8..0d097f5 100644 --- a/spec/errbit_plugin/validate_issue_tracker_spec.rb +++ b/spec/errbit_plugin/validate_issue_tracker_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require "spec_helper" -describe ErrbitPlugin::ValidateIssueTracker do +RSpec.describe ErrbitPlugin::ValidateIssueTracker do describe "#valid?" do context "with a complete class" do klass = Class.new(ErrbitPlugin::IssueTracker) do @@ -42,7 +44,7 @@ def url end it "valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(true) end end @@ -89,7 +91,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "says :not_inherited" do @@ -135,7 +137,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement label method" do @@ -181,7 +183,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement icons method" do @@ -227,7 +229,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement fields method" do @@ -273,7 +275,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement configured? method" do @@ -319,7 +321,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement errors method" do @@ -365,7 +367,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement create_issue method" do is = ErrbitPlugin::ValidateIssueTracker.new(klass) @@ -411,7 +413,7 @@ def url end it "is valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be true + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(true) end it "not say not implement close_issue method" do is = ErrbitPlugin::ValidateIssueTracker.new(klass) @@ -456,7 +458,7 @@ def close_issue end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement url method" do @@ -502,7 +504,7 @@ def url end it "not valid" do - expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to be false + expect(ErrbitPlugin::ValidateIssueTracker.new(klass).valid?).to eq(false) end it "say not implement note method" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d679395..05b1ac9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,26 +1,29 @@ -if ENV["COVERAGE"] - require "simplecov" - if ENV["CI"] - require "coveralls" - Coveralls.wear! - SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter - ] - end +# frozen_string_literal: true + +require "simplecov" + +if ENV["CI"] == "yes" + require "simplecov-cobertura" - SimpleCov.start + SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter end -require "errbit_plugin" +SimpleCov.start do + enable_coverage :branch + + primary_coverage :branch +end + +require "errbit-ng-plugin" RSpec.configure do |config| - config.run_all_when_everything_filtered = true - config.filter_run :focus - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = "random" + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end end