spec/lib/idy/extension/salt_spec.rb in idy-0.1.3 vs spec/lib/idy/extension/salt_spec.rb in idy-1.0.0
- old
+ new
@@ -1,21 +1,19 @@
# frozen_string_literal: true
require 'rails_helper'
-RSpec.describe ':salt' do
+RSpec.describe Clean, ':salt' do
describe '#salt' do
- before do
- allow(Clean).to receive(:idy_options) { { salt: :salty } }
- end
+ before { allow(Clean).to receive(:idy_options).and_return(salt: :salty) }
it 'fetchs the salt options' do
expect(Clean.salt).to eq(:salty)
end
end
describe '.salt' do
- before { allow(Clean).to receive(:salt) { :salt } }
+ before { allow(Clean).to receive(:salt).and_return :salt }
it 'delegates to class method' do
expect(Clean.new.salt).to eq :salt
end
end