spec/readme_spec.rb in windcharger-0.2.0 vs spec/readme_spec.rb in windcharger-0.3.0
- old
+ new
@@ -40,10 +40,20 @@
attribute
def bar
:walked_into_a_bar
end
+ def qux
+ 1
+ end
+
+ attribute :qax, :qux
+
+ def qax
+ 2
+ end
+
def not_an_attribute
42
end
end
end
@@ -52,9 +62,14 @@
Object.send :remove_const, :MyTransformer
end
it "works" do
my_transformer = MyTransformer.new
- expect(my_transformer.transform).to eq({ :foo => :the_foo, :bar => :walked_into_a_bar })
+ expect(my_transformer.transform).to eq({
+ :foo => :the_foo,
+ :bar => :walked_into_a_bar,
+ :qax => 2,
+ :qux => 1,
+ })
end
end
end