spec/singular_spec.rb in cistern-2.4.1 vs spec/singular_spec.rb in cistern-2.5.0
- old
+ new
@@ -1,25 +1,27 @@
require 'spec_helper'
describe 'Cistern::Singular' do
- class Settings < Sample::Singular
- attribute :name, type: :string
- attribute :count, type: :number
+ before {
+ class Sample::Settings < Sample::Singular
+ attribute :name, type: :string
+ attribute :count, type: :number
- def save
- result = @@settings = attributes.merge(dirty_attributes)
+ def save
+ result = @@settings = attributes.merge(dirty_attributes)
- merge_attributes(result)
- end
+ merge_attributes(result)
+ end
- def get
- settings = @@settings ||= {}
- settings[:count] ||= 0
- settings[:count] += 1
+ def get
+ settings = @@settings ||= {}
+ settings[:count] ||= 0
+ settings[:count] += 1
- merge_attributes(settings)
+ merge_attributes(settings)
+ end
end
- end
+ }
let!(:service) { Sample.new }
describe 'deprecation', :deprecated do
it 'responds to #service' do