Sha256: be8863a7120242fe7f7a3c7663d4413ff66bae94c08693f77440cbb6baa005eb
Contents?: true
Size: 1.95 KB
Versions: 16
Compression:
Stored size: 1.95 KB
Contents
require 'test_helper' module Vedeu class ToggleableTestClass include Vedeu::Toggleable def initialize(boolean) @visible = boolean end def store self end end describe Toggleable do let(:described) { Vedeu::Toggleable } let(:instance) { Vedeu::ToggleableTestClass.new(visible) } let(:visible) { false } describe 'accessors' do it { instance.must_respond_to(:visible) } it { instance.must_respond_to(:visible=) } it { instance.must_respond_to(:visible?) } end describe '#hide' do subject { instance.hide } it { subject instance.instance_variable_get('@visible').must_equal(false) } it { Vedeu::ToggleableTestClass.must_respond_to(:hide_cursor) } it { Vedeu::ToggleableTestClass.must_respond_to(:hide_group) } it { Vedeu::ToggleableTestClass.must_respond_to(:hide_interface) } end describe '#show' do subject { instance.show } it { subject instance.instance_variable_get('@visible').must_equal(true) } it { Vedeu::ToggleableTestClass.must_respond_to(:show_cursor) } it { Vedeu::ToggleableTestClass.must_respond_to(:show_group) } it { Vedeu::ToggleableTestClass.must_respond_to(:show_interface) } end describe '#toggle' do subject { instance.toggle } it { Vedeu::ToggleableTestClass.must_respond_to(:toggle_cursor) } it { Vedeu::ToggleableTestClass.must_respond_to(:toggle_group) } it { Vedeu::ToggleableTestClass.must_respond_to(:toggle_interface) } context 'when the model is visible' do let(:visible) { true } it { subject instance.instance_variable_get('@visible').must_equal(false) } end context 'when the model is not visible' do it { subject instance.instance_variable_get('@visible').must_equal(true) } end end end # Toggleable end # Vedeu
Version data entries
16 entries across 16 versions & 1 rubygems