spec/unit/model_spec.rb in evil-client-3.0.4 vs spec/unit/model_spec.rb in evil-client-3.1.0

- old
+ new

@@ -1,11 +1,11 @@ RSpec.describe Evil::Client::Model do before { class Test::Model < described_class; end } - let(:model) { klass.new(options) } + let(:model) { klass.new(**options) } let(:klass) { Test::Model } - let(:options) { { "id" => 42, "name" => "Andrew" } } + let(:options) { { id: 42, name: "Andrew" } } let(:dsl_methods) do %i[options datetime logger scope basic_auth key_auth token_auth] end describe ".policy" do @@ -62,10 +62,10 @@ before do klass.option :name klass.validate { errors.add :name_present if name.to_s == "" } end - let(:options) { { "name" => "" } } + let(:options) { { name: "" } } it "adds validation for an instance" do # see spec/fixtures/locale/en.yml expect { model } .to raise_error(StandardError, /The user has no name/)