Stack.new } subject { @stack } its(:empty?) { should be_true } end context 'ۭͷ߹' do before { @stack = Stack.new } describe '#size' do subject { @stack.size } it { should == 0 } end describe '#pop' do subject { lambda { @stack.pop } } it { should raise_error(Stack::EmptyError) } end describe '#push' do subject { lambda { @stack.push(Object.new) } } it { should change(@stack, :size).by(1) } end end end
"Hello Variable!" end def say_hello puts @message end end describe Hello do it "has a say_hello method" do binding.pry subject.respond_to?(:say_hello) end end