Sha256: 624871f72b3c015b9dc75dcc59e23f3f89f67e591c42f0126c8bea538a5fec3f
Contents?: true
Size: 730 Bytes
Versions: 25
Compression:
Stored size: 730 Bytes
Contents
require 'spec_helper' describe Resource::Serialization::Boolean do [true, "true", "TRUE", "1", 1, 1.0, "x", "X", "t", "T"].each do |true_value| context "when value is #{true_value}" do it "returns true" do subject.class.serialize(true_value).should be_true end end end [false, "false", "FALSE", "0", 0, 0.0, "", " ", "f", "F", nil].each do |false_value| context "when value is #{false_value}" do it "returns false" do subject.class.serialize(false_value).should be_false end end end context "when an invalid value is serialized" do it "raises an error" do expect {subject.class.serialize("neither true or false")}.to raise_error end end end
Version data entries
25 entries across 25 versions & 1 rubygems