spec/normalizy/rspec/matcher/matches_spec.rb in normalizy-1.1.1 vs spec/normalizy/rspec/matcher/matches_spec.rb in normalizy-1.2.0

- old
+ new

@@ -3,52 +3,52 @@ require 'rails_helper' RSpec.describe Normalizy::RSpec::Matcher, '.matches?' do let!(:object) { Match.new } - specify do + it do matcher = described_class.new(:alone) matcher.matches?(object) expect(matcher.instance_variable_get(:@subject)).to eq object end context 'when .with is called' do - specify do + it do matcher = described_class.new(:alone) matcher.with :missing expect(matcher.matches?(object)).to eq false end - specify do + it do matcher = described_class.new(:downcase_field) matcher.with :downcase expect(matcher.matches?(object)).to eq true end - specify do + it do matcher = described_class.new(:trim_side_left) matcher.with trim: { side: :left } expect(matcher.matches?(object)).to eq true end - specify do + it do matcher = described_class.new(:trim_side_left_array) matcher.with trim: { side: :left } expect(matcher.matches?(object)).to eq true end - specify do + it do Normalizy.configure do |config| config.default_filters = :squish end matcher = described_class.new(:alone) @@ -56,11 +56,11 @@ matcher.with :squish expect(matcher.matches?(object)).to eq true end - specify do + it do Normalizy.configure do |config| config.default_filters = [:squish] end matcher = described_class.new(:alone) @@ -68,11 +68,11 @@ matcher.with :squish expect(matcher.matches?(object)).to eq true end - specify do + it do Normalizy.configure do |config| config.default_filters = [{ strip: { side: :left } }] end matcher = described_class.new(:alone) @@ -80,11 +80,11 @@ matcher.with(strip: { side: :left }) expect(matcher.matches?(object)).to eq true end - specify do + it do Normalizy.configure do |config| config.default_filters = :squish end matcher = described_class.new(:downcase_field) @@ -94,19 +94,19 @@ expect(matcher.matches?(object)).to eq false end end context 'when .with is not called' do - specify do + it do matcher = described_class.new(:alone) matcher.from '1' matcher.to '2' expect(matcher.matches?(object)).to eq false end - specify do + it do matcher = described_class.new(:downcase_field) matcher.from 'BOTELHO' matcher.to 'botelho'