spec/struct_spec.rb in fear-1.2.0 vs spec/struct_spec.rb in fear-2.0.0
- old
+ new
@@ -166,11 +166,11 @@
end
context "string attributes" do
subject { -> { struct.copy("a" => 44) } }
- it { is_expected.to raise_error(ArgumentError, "wrong number of arguments (given 1, expected 0)") }
+ it { is_expected.to raise_error(ArgumentError) }
end
context "no attributes given" do
subject { struct.copy == struct }
@@ -188,39 +188,7 @@
describe "#inspect" do
subject { StrToS.new(a: 2, b: nil).inspect }
StrToS = Fear::Struct.with_attributes(:a, :b)
it { is_expected.to eq("<#Fear::Struct StrToS a=2, b=nil>") }
- end
-
- context "extract" do
- Str = Fear::Struct.with_attributes(:a, :b)
- let(:struct) { Str.new(b: 43, a: 42) }
-
- context "Fear::Struct subclass" do
- context "match by one member" do
- subject do
- proc do |effect|
- struct.match do |m|
- m.xcase("Str(a, 43)", &effect)
- end
- end
- end
-
- it { is_expected.to yield_with_args(a: 42) }
- end
-
- context "does not match" do
- subject do
- proc do |effect|
- struct.match do |m|
- m.xcase("Str(_, 40)", &effect)
- m.else {}
- end
- end
- end
-
- it { is_expected.not_to yield_control }
- end
- end
end
end