M .hgignore +1 -0
@@ 6,3 6,4 @@ ChangeLog
^\.rbx/
\.rbx/
\.lock$
+^spec/\.status$
M README.md +5 -2
@@ 3,11 3,14 @@
home
: https://hg.sr.ht/~ged/Schedulability
+code
+: https://hg.sr.ht/~ged/Schedulability
+
docs
-: http://deveiate.org/code/schedulability
+: https://deveiate.org/code/schedulability
github
-: http://github.com/ged/schedulability
+: https://github.com/ged/schedulability
## Description
M lib/schedulability.rb +1 -1
@@ 1,6 1,6 @@
# -*- ruby -*-
+# frozen_string_literal: true
# vim: set nosta noet ts=4 sw=4:
-# encoding: utf-8
require 'loggability'
M lib/schedulability/exceptions.rb +1 -1
@@ 1,5 1,5 @@
# -*- ruby -*-
-#encoding: utf-8
+# frozen_string_literal: true
require 'schedulability' unless defined?( Schedulability )
M lib/schedulability/parser.rb +2 -2
@@ 1,5 1,5 @@
# -*- ruby -*-
-#encoding: utf-8
+# frozen_string_literal: true
require 'loggability'
require 'schedulability' unless defined?( Schedulability )
@@ 62,7 62,7 @@ module Schedulability::Parser
periods.each do |period|
period_string = []
period.sort_by{|k, v| k}.each do |scale, ranges|
- range_string = ""
+ range_string = String.new( encoding: 'utf-8' )
range_string << "%s { " % [ scale.to_s ]
range_strings = ranges.each_with_object( [] ).each do |range, acc|
M lib/schedulability/schedule.rb +1 -1
@@ 1,5 1,5 @@
# -*- ruby -*-
-#encoding: utf-8
+# frozen_string_literal: true
require 'strscan'
M spec/helpers.rb +9 -6
@@ 1,6 1,6 @@
#!/usr/bin/env ruby
# vim: set nosta noet ts=4 sw=4:
-# encoding: utf-8
+# frozen_string_literal: true
BEGIN {
require 'pathname'
@@ 31,17 31,20 @@ end # module Schedulability::SpecHelpers
### Mock with RSpec
RSpec.configure do |config|
- config.run_all_when_everything_filtered = true
- config.filter_run :focus
- config.order = 'random'
- config.warnings = true
config.mock_with( :rspec ) do |mock|
mock.syntax = :expect
end
+ config.disable_monkey_patching!
+ config.example_status_persistence_file_path = "spec/.status"
+ config.filter_run :focus
+ config.filter_run_when_matching :focus
+ config.order = :random
+ config.profile_examples = 5
+ config.run_all_when_everything_filtered = true
+ config.shared_context_metadata_behavior = :apply_to_host_groups
config.warnings = true
- config.profile_examples = 5
config.include( Loggability::SpecHelpers )
config.include( Schedulability::SpecHelpers )
M spec/schedulability/parser_spec.rb +1 -1
@@ 5,7 5,7 @@ require_relative '../helpers'
require 'schedulability/parser'
-describe Schedulability::Parser do
+RSpec.describe Schedulability::Parser do
it "can parse a single time period structure from a string" do
M spec/schedulability/schedule_spec.rb +1 -1
@@ 7,7 7,7 @@ require 'timecop'
require 'schedulability/schedule'
-describe Schedulability::Schedule do
+RSpec.describe Schedulability::Schedule do
before( :all ) do
@actual_zone = ENV['TZ']
M spec/schedulability_spec.rb +3 -1
@@ 7,7 7,9 @@ require 'rspec'
require 'schedulability'
-describe Schedulability do
+RSpec.describe Schedulability do
+
+ # This is just a namespace so there isn't anything to test
end