Sha256: da680cae8137dd4519d888f0da4327b2cdc2c0006edaddd9d90e48290a71d393

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

$:.unshift File.expand_path('../../lib', __FILE__)

require 'bacon'
require 'ovaltine/storyboard'
require 'ovaltine/objc/storyboard_formatter'

describe 'StoryboardFormatter' do

  it 'writes valid output paths' do
    storyboard = Ovaltine::Storyboard.new('Main?P', [])
    formatter  = Ovaltine::StoryboardFormatter.new(storyboard, '', '.')
    names = formatter.output_paths.map {|p| File.basename(p)}
    names.should.include 'Main_PStoryboard.m'
    names.should.include 'Main_PStoryboard.h'
  end

  it 'uses the prefix in output paths' do
    storyboard = Ovaltine::Storyboard.new('Main_iPhone', [])
    formatter  = Ovaltine::StoryboardFormatter.new(storyboard, 'ABC', '.')
    names = formatter.output_paths.map {|p| File.basename(p)}
    names.should.include 'ABCMain_iPhoneStoryboard.m'
    names.should.include 'ABCMain_iPhoneStoryboard.h'
  end

  it 'uses the prefix in the generated class name' do
    storyboard = Ovaltine::Storyboard.new('Onboarding', [])
    formatter  = Ovaltine::StoryboardFormatter.new(storyboard, 'DMU', '.')
    formatter.classname.should.equal 'DMUOnboardingStoryboard'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ovaltine-1.0.5 specs/storyboard_formatter_spec.rb
ovaltine-1.0.4 specs/storyboard_formatter_spec.rb