Skip to content

Commit

Permalink
Remove block returns for Rspec 1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ragaskar committed Aug 1, 2012
1 parent bcf23c3 commit 809bea5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion spec/config_spec.rb
Expand Up @@ -261,21 +261,25 @@
before do
Jasmine::Dependencies.stub(:rails_3_asset_pipeline?) { true }
end

let(:src_files) { ["assets/some.js", "assets/files.js"] }

let(:config) do
Jasmine::Config.new.tap do |config|
#TODO: simple_config should be a passed in hash
config.stub(:simple_config) { { 'src_files' => src_files} }
end
end

it "should use AssetPipelineMapper to return src_files" do
mapped_files = ["some.js", "files.js"]
Jasmine::AssetPipelineMapper.stub_chain(:new, :files).and_return(mapped_files)
config.src_files.should == mapped_files
end

it "should pass the config src_files to the AssetPipelineMapper" do
Jasmine::Config.stub(:simple_config)
Jasmine::AssetPipelineMapper.should_receive(:new).with(src_files) { double("mapper").as_null_object }
Jasmine::AssetPipelineMapper.should_receive(:new).with(src_files).and_return(double("mapper").as_null_object)
config.src_files
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/server_spec.rb
Expand Up @@ -10,7 +10,7 @@
server = double(:server)
port = 1234
application = double(:application)
Rack::Handler.should_receive(:get).with("webrick") { server }
Rack::Handler.should_receive(:get).with("webrick").and_return(server)
server.should_receive(:run).with(application, hash_including(:Port => port))
Jasmine::Server.new(port, application).start
end
Expand All @@ -26,7 +26,7 @@

it "should create a Rack::Server with the correct port when passed" do
port = 1234
Rack::Server.should_receive(:new).with(hash_including(:Port => port)) { double(:server).as_null_object }
Rack::Server.should_receive(:new).with(hash_including(:Port => port)).and_return(double(:server).as_null_object)
Jasmine::Server.new(port).start
end

Expand Down

0 comments on commit 809bea5

Please sign in to comment.