Sha256: caab7c4f13631350ada1e21def8677631fd608960f14e37b79ea5871703fdb1c

Contents?: true

Size: 953 Bytes

Versions: 3

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'

class NavigationTestScreen
end

include Mohawk::Navigation

describe Mohawk::Navigation do
  before(:each) do
    allow(NavigationTestScreen).to receive(: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

3 entries across 3 versions & 1 rubygems

Version Path
mohawk-1.0 spec/lib/navigation_spec.rb
mohawk-0.4.4 spec/lib/navigation_spec.rb
mohawk-0.4.3 spec/lib/navigation_spec.rb