Sha256: b595f7cfd73148c06051fde545915d72c71d2b8dd17ccab13e446cc7966ccadf

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

class SpinnerScreen
  include Mohawk
  window(:id => 123)

  spinner(:price_is_right, :id => 'barker')
end

describe Mohawk::Accessors::Spinner do
  let(:window) { double('RAutomation Window') }
  let(:spinner) { double('RAutomation Spinner') }
  subject { SpinnerScreen.new }

  before(:each) do
    RAutomation::Window.stub(:new).and_return(window)
    window.should_receive(:spinner).with(:id => 'barker').and_return(spinner)
  end

  it 'knows the value' do
    spinner.should_receive(:value).and_return(11.0)
    subject.price_is_right.should eq(11.0)
  end

  it 'can set the value' do
    spinner.should_receive(:set).with(11.0)
    subject.price_is_right = 11.0
  end

  it 'can be incremented' do
    spinner.should_receive(:increment).and_return(11.0)
    subject.increment_price_is_right.should eq(11.0)
  end

  it 'can be decremented' do
    spinner.should_receive(:decrement).and_return(11.0)
    subject.decrement_price_is_right.should eq(11.0)
  end

  it 'can get the view' do
    subject.price_is_right_view.should be(spinner)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mohawk-0.1.4 spec/lib/mohawk/accessors/spinner_spec.rb
mohawk-0.1.0 spec/lib/mohawk/accessors/spinner_spec.rb
mohawk-0.0.9 spec/lib/mohawk/accessors/spinner_spec.rb
mohawk-0.0.8 spec/lib/mohawk/accessors/spinner_spec.rb