タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

sinatraとrspec2に関するa2ikmのブックマーク (1)

  • SinatraのHelpersをRspecでテストする - komagataのブログ

    module Foo module Helpers def bar 'unk' end end end こういうHelpersを helpers do include Foo::Helpers end こういう風に使ってた場合。 RSpec.configure do |config| config.include Foo::Helpers end describe Foo::Helpers do context 'bar' do it 'should return unk' do bar.should eql('unk') end end end Spec::Runner.configでincludeするとテスト出来る。 LokkaはSinatraベースなので同じようにHelpersのテスト書ける。でもRspecややこしいな。config.includeのとことか。とTest::Unit,

    a2ikm
    a2ikm 2011/12/14
    セッションとか使っている場合はダミーのアプリケーション使わなきゃダメかなぁ
  • 1