Sha256: 97f277db63a5d0ae9547e2199f4d17ed1a104b724c4144e5cfc57f983b2a27f5

Contents?: true

Size: 940 Bytes

Versions: 6

Compression:

Stored size: 940 Bytes

Contents

require 'spec_helper'

class NavigationTestScreen
end

include Mohawk::Navigation

describe Mohawk::Navigation do
  before(:each) do
    NavigationTestScreen.stub(:new).and_return(screen)
  end

  Given(:screen) { double('Mohawk Screen').as_null_object }

  Then { on(NavigationTestScreen) == screen }

  context 'blocks' do
    When { on(NavigationTestScreen) {|s| s.expected_method } }
    Then { expect(screen).to have_received(:expected_method) }
  end

  context 'waiting until it exists' do
    When { on(NavigationTestScreen).was_used }
    Then { expect(screen).to have_received :wait_until_present }
    And { expect(screen).to have_received :was_used }
  end

  context 'additional information' do
    Given { expect(NavigationTestScreen).to receive(:new).with(extra: :info).and_return(screen) }
    When(:result) { on(NavigationTestScreen, extra: :info) }
    Then { result == screen }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mohawk-0.4.2 spec/lib/navigation_spec.rb
mohawk-0.4.1 spec/lib/navigation_spec.rb
mohawk-0.4 spec/lib/navigation_spec.rb
mohawk-0.3 spec/lib/navigation_spec.rb
mohawk-0.2.1 spec/lib/navigation_spec.rb
mohawk-0.2 spec/lib/navigation_spec.rb