Sha256: 275a48fe66ec27e378793e8978f7320c64f96444675866019f13ee9ba572cac6
Contents?: true
Size: 1.16 KB
Versions: 24
Compression:
Stored size: 1.16 KB
Contents
require 'test_helper' class GroupTest < Minitest::Test def setup @experiment = Verdict::Experiment.new('a') end def test_basic_properties group = Verdict::Group.new(@experiment, :test) assert_equal @experiment, group.experiment assert_kind_of Verdict::Group, group assert_equal 'test', group.handle assert_equal 'test', group.to_s assert_equal :test, group.to_sym end def test_triple_equals group = Verdict::Group.new(@experiment, 'control') assert group === Verdict::Group.new(@experiment, :control) assert group === 'control' assert group === :control assert !(group === nil) assert !(group === Verdict::Group.new(@experiment, :test)) assert !(group === Verdict::Group.new(Verdict::Experiment.new('b'), :test)) assert !(group === 'test') assert !(group === nil) end def test_json group = Verdict::Group.new(@experiment, 'control') group.name 'testing' group.description 'description' json = JSON.parse(group.to_json) assert_equal 'control', json['handle'] assert_equal 'testing', json['metadata']['name'] assert_equal 'description', json['metadata']['description'] end end
Version data entries
24 entries across 24 versions & 1 rubygems
Version | Path |
---|---|
verdict-0.3.2 | test/group_test.rb |
verdict-0.3.1 | test/group_test.rb |
verdict-0.3.0 | test/group_test.rb |
verdict-0.2.1 | test/group_test.rb |