Sha256: df462a852ebe3bea1b860b6ebc2698ed3b73c4a1a3f53d90329fad3546fbb44b
Contents?: true
Size: 1.01 KB
Versions: 13
Compression:
Stored size: 1.01 KB
Contents
require "hanami" RSpec.describe "App view / Context / Inflector", :app_integration do before do module TestApp class App < Hanami::App end end Hanami.prepare module TestApp module Views class Context < Hanami::View::Context end end end end let(:context_class) { TestApp::Views::Context } subject(:context) { context_class.new } describe "#inflector" do it "is the app inflector by default" do expect(context.inflector).to be TestApp::App.inflector end context "injected inflector" do subject(:context) { context_class.new(inflector: inflector) } let(:inflector) { double(:inflector) } it "is the injected inflector" do expect(context.inflector).to be inflector end context "rebuilt context" do subject(:new_context) { context.with } it "retains the injected inflector" do expect(new_context.inflector).to be inflector end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems