Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
459 changes: 247 additions & 212 deletions ext/json/parser/parser.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/mspec/Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org'

gem "rake", "~> 12.3"
gem "rake"
gem "rspec", "~> 3.0"
4 changes: 2 additions & 2 deletions spec/mspec/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.4.4)
rake (12.3.3)
rake (13.4.2)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
Expand All @@ -22,5 +22,5 @@ PLATFORMS
ruby

DEPENDENCIES
rake (~> 12.3)
rake
rspec (~> 3.0)
2 changes: 2 additions & 0 deletions spec/mspec/lib/mspec/matchers/base.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'mspec/utils/deprecate'

module MSpecMatchers
end

Expand Down
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_an_instance_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def negative_failure_message

module MSpecMatchers
private def be_an_instance_of(expected)
MSpec.deprecate __method__, '.should.instance_of?'
BeAnInstanceOfMatcher.new(expected)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_ancestor_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def be_ancestor_of(expected)
MSpec.deprecate __method__, '.ancestors.should.include?'
BeAncestorOfMatcher.new(expected)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_empty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def negative_failure_message

module MSpecMatchers
private def be_empty
MSpec.deprecate __method__, '.should.empty?'
BeEmptyMatcher.new
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_false.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def negative_failure_message

module MSpecMatchers
private def be_false
MSpec.deprecate __method__, '.should == false'
BeFalseMatcher.new
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_kind_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def be_kind_of(expected)
MSpec.deprecate __method__, '.should.is_a?'
BeKindOfMatcher.new(expected)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_nan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def negative_failure_message

module MSpecMatchers
private def be_nan
MSpec.deprecate __method__, '.should.nan?'
BeNaNMatcher.new
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_nil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def negative_failure_message

module MSpecMatchers
private def be_nil
MSpec.deprecate __method__, '.should == nil'
BeNilMatcher.new
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/be_true.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def negative_failure_message

module MSpecMatchers
private def be_true
MSpec.deprecate __method__, '.should == true'
BeTrueMatcher.new
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/eql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def negative_failure_message

module MSpecMatchers
private def eql(expected)
MSpec.deprecate __method__, '.should.eql?'
EqlMatcher.new(expected)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/equal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def negative_failure_message

module MSpecMatchers
private def equal(expected)
MSpec.deprecate __method__, '.should.equal?'
EqualMatcher.new(expected)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_class_variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class HaveClassVariableMatcher < VariableMatcher

module MSpecMatchers
private def have_class_variable(variable)
MSpec.deprecate __method__, '.should.class_variable_defined?'
HaveClassVariableMatcher.new(variable)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_constant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class HaveConstantMatcher < VariableMatcher

module MSpecMatchers
private def have_constant(variable)
MSpec.deprecate __method__, '.should.const_defined?'
HaveConstantMatcher.new(variable)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_instance_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_instance_method(method, include_super = true)
MSpec.deprecate __method__, '.should.method_defined?'
HaveInstanceMethodMatcher.new method, include_super
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_instance_variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class HaveInstanceVariableMatcher < VariableMatcher

module MSpecMatchers
private def have_instance_variable(variable)
MSpec.deprecate __method__, '.should.instance_variable_defined?'
HaveInstanceVariableMatcher.new(variable)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_method(method, include_super = true)
MSpec.deprecate __method__, '.should.respond_to?'
HaveMethodMatcher.new method, include_super
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_private_instance_method(method, include_super = true)
MSpec.deprecate __method__, '.private_instance_methods(false).should.include?'
HavePrivateInstanceMethodMatcher.new method, include_super
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_private_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_private_method(method, include_super = true)
MSpec.deprecate __method__, '.private_methods(false).should.include?'
HavePrivateMethodMatcher.new method, include_super
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_protected_instance_method(method, include_super = true)
MSpec.deprecate __method__, '.protected_instance_methods(false).should.include?'
HaveProtectedInstanceMethodMatcher.new method, include_super
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_public_instance_method(method, include_super = true)
MSpec.deprecate __method__, '.public_instance_methods(false).should.include?'
HavePublicInstanceMethodMatcher.new method, include_super
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/have_singleton_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def have_singleton_method(method, include_super = true)
MSpec.deprecate __method__, '.singleton_methods(false).should.include?'
HaveSingletonMethodMatcher.new method, include_super
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/include.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def negative_failure_message
# Cannot override #include at the toplevel in MRI
module MSpecMatchers
private def include(*expected)
MSpec.deprecate __method__, '.should.include?'
IncludeMatcher.new(*expected)
end
end
2 changes: 2 additions & 0 deletions spec/mspec/lib/mspec/matchers/infinity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ def negative_failure_message

module MSpecMatchers
private def be_positive_infinity
MSpec.deprecate __method__, '.should.infinite? == 1'
InfinityMatcher.new(1)
end

private def be_negative_infinity
MSpec.deprecate __method__, '.should.infinite? == -1'
InfinityMatcher.new(-1)
end
end
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/raise_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def negative_failure_message

module MSpecMatchers
private def raise_error(exception = Exception, message = nil, options = nil, &block)
MSpec.deprecate __method__, '.should.raise'
RaiseErrorMatcher.new(exception, message, options, &block)
end

Expand Down
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers/respond_to.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def negative_failure_message

module MSpecMatchers
private def respond_to(expected)
MSpec.deprecate __method__, '.should.respond_to?'
RespondToMatcher.new(expected)
end
end
4 changes: 2 additions & 2 deletions spec/mspec/spec/fixtures/should.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def finish
# Specs
describe "MSpec expectation method #should" do
it "accepts a matcher" do
:sym.should be_kind_of(Symbol)
0.4.should be_close(0.5, 0.2)
end

it "causes a failure to be recorded" do
Expand All @@ -59,7 +59,7 @@ def finish

describe "MSpec expectation method #should_not" do
it "accepts a matcher" do
"sym".should_not be_kind_of(Symbol)
0.1.should_not be_close(0.5, 0.2)
end

it "causes a failure to be recorded" do
Expand Down
4 changes: 2 additions & 2 deletions spec/mspec/spec/matchers/raise_error_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UnexpectedException < Exception; end
ensure_mspec_method(-> {}.method(:should))

run = false
-> { raise ExpectedException }.should PublicMSpecMatchers.raise_error { |error|
-> { raise ExpectedException }.should.raise { |error|
expect(error.class).to eq(ExpectedException)
run = true
}
Expand All @@ -30,7 +30,7 @@ class UnexpectedException < Exception; end
ensure_mspec_method(-> {}.method(:should))

run = false
-> { raise ExpectedException }.should PublicMSpecMatchers.raise_error do |error|
-> { raise ExpectedException }.should.raise do |error|
expect(error.class).to eq(ExpectedException)
run = true
end
Expand Down
5 changes: 0 additions & 5 deletions spec/mspec/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,4 @@ def ensure_mspec_method(method)
expect(file).to start_with(File.expand_path('../../lib/mspec', __FILE__ ))
end

PublicMSpecMatchers = Class.new {
include MSpecMatchers
public :raise_error
}.new

BACKTRACE_QUOTE = RUBY_VERSION >= "3.4" ? "'" : "`"
Loading